0

[solved] Why wont my script teleport players?

Edited 1 month ago

So I made a simple script to teleport all players to one point after a function is called, but for some reason It does not teleport anyone. I didnt get any error in output and yes, I am sure the function runs properly. Here is the script I am using:

local proximity = script.Parent

proximity.Triggered:Connect(function()
for i,v in pairs(players) do
v.Character.HumanoidRootPart.CFrame = workspace.playertpspawn.CFrame
end
proximity.Enabled = false
end)


Does someone know what am I doing wrong?

edit: I have just noticed that the issue is probably not with the v.Character.HumanoidRootPart.CFrame = workspace.playertpspawn.CFrame but with the for function, it just does not run.