I want that when the player has an exact amount of "Objects" in leaderboard stats, he is teleported,im using that script,but it is not working,What is wrong?
Position=Vector3.new(-46.078, 5.046, -1105.82)
game.Players.PlayerAdded:connect(function(p)
local stats = Instance.new("IntValue", p)
stats.Name = "leaderstats"
local objects = Instance.new("IntValue", stats)
objects.Name = "Objects"
objects.Value = 0
while true do
wait (1)
if objects.Value = 5 then
FindFirstChild("Humanoid") then
Torso.CFrame=CFrame.new(Position)
end
end
end
end)

2 comments
use code blocks please
Done.