#it stops and just doesnt do anything after printing "finding plot"

1 messages · Page 1 of 1 (latest)

regal pivot
#

local Players = game:GetService("Players")
local player = Players.LocalPlayer

Players.PlayerAdded:Connect(function(player)
    wait(0.2)
    local leaderstats = player:WaitForChild("leaderstats")
    local plot1 = workspace.plot1
    local plot2 = workspace.plot2
    print("finding plot")
    if plot1.Istaken.Value == true then
        print("plot 1 taken trying plot 2")
        if plot2.Istaken.Value == true then
            print("plot 2 taken")
            if plot1.Istaken.Value == false then
                print("giving player plot 1")
                player.leaderstats.plot.Value += 1
                print("gave player plot 1")
                if plot2.Istaken.Value == false then
                    print("giving player plot 2")
                    player.leaderstats.plot.Value += 2
                    print("gave player plot 2")
                else
                    print("all plots are taken how tf are you here")
                    print("found plot")
                end
            end
        end
    end
end)

it just stops after finding plot

regal pivot
#

wut

granite solar
#

Search up code nesting

slim monolith
stone wolf
#

Istaken is a boolvalue?

#

have you tried manually setting the boolvalue to true, like is there another script acting on it

#

also, i'm not 100% sure if it's what you want to do but plot.Value should just be set instead of added. if the player has plot 1 (plot.Value = 1) and then claims plot 2, plot.Value will then be 3