It wasn't global before, but now since a few updates it makes everyone teleport when the button is pressed. I'm not sure what needs to change to accommodate the recent updates, and that only the player who had clicked it teleports.
Here is my script:
local Part = script.Parent.Parent.Teleport1stFloor6
local offset = 1
math.randomseed(tick())
function onClicked()
script.Beep2:Play()
for count = 1,1 do
local counter = math.random(1)
local counterr = math.random(1)
local counterrr = math.random(1)
print(counter)
print(counterr)
print(counterrr)
local c = game.Players:GetChildren()
for i = 1, #c do
c[i].Character.Torso.CFrame = CFrame.new(Part.Position + Vector3.new(counter, counterrr, counterr - 4))
wait(1)
end
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
Thank you so much!

1 comment
I tried using both methods of calling c = , but I get the same error every time = attempt to get length of local 'c' (a userdata value) :(