local Spawn1 = game.Workspace:WaitForChild("Spawn1")
local Spawn2 = game.Workspace:WaitForChild("Spawn2")
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
task.wait(1)
if player:FindFirstChild("Stage") then
local Stage = player.Stage.Value
if Stage == 1 then
player.Character:FindFirstChild("HumanoidRootPart").CFrame = Spawn1.CFrame + Vector3.new(0,2,0)
elseif Stage == 2 then
player.Character:FindFirstChild("HumanoidRootPart").CFrame = Spawn2.CFrame + Vector3.new(0,2,0)
end
end
end)
end)
Hello, everything in this script works fine but I don’t want to use task.wait anymore because the time it takes to tp the player can vary and I don’t want that. The stage is a datastore value so it doesn’t load in instantly. How can I make it keep checking for the stage until 1 or 2?