It works at first but then 1 second later it teleports, even when I'm not touching it?
local table = {
"Player1",
"",
""
}
cooldown = false
place = workspace.ToSpawn
script.Parent.Touched:connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) and (not cooldown) then
cooldown = true
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
local chr = plr.Character
for i,v in pairs(table) do
if plr.Name == v then
script.Parent.CanCollide = false
script.Parent.Transparency = .3
wait(1)
script.Parent.CanCollide = true
script.Parent.Transparency = 0
cooldown = false
else
chr:WaitForChild("HumanoidRootPart")
chr.HumanoidRootPart.CFrame = place.CFrame + Vector3.new(0,2,0)
cooldown = false
end
end
end
end)
Not sure at all, is it waiting then going back to it?

3 comments
Nothing seems wrong with your script, its probably just the server registering the hit a little bit late.
connect is deprecated. Use Connect.
thunder pls don't lose sleep over a dumb capitalization quirk