So I have a script that puts a player’s user ID in a intvalue, but it keeps giving me 0.
print("start")
local function OnPlayerAdded(player)
while wait(0.5) do
local cube = cubes[math.random(1, #cubes)]
print(2)
print(cube.occupied.Value)
if not cube.occupied.Value then
print(3)
cube.owner.bill:WaitForChild("label").Text = player.Name
cube.owner.bill.label:WaitForChild("User").Value = player.UserId
repeat wait()
until player.UserId~=0
print("success")
cube.occupied.Value = true
break
else
print("retry")
end
end
end
game.Players.PlayerAdded:Connect(OnPlayerAdded)
for i, v in pairs(game.Players:GetPlayers()) do
OnPlayerAdded(v)
end
Oh that’s for something else.
The script is meant to pick a random area and I needed the UserID so I could let only the player who owned the area sit in a seat there.
Also that = false.