This is the code that isn't working for me.
I just want to move character away from that room that he is in after clicking. I give money when player clicks so i don't want them to keep clicking so any solution would be good. even if player goes back to spawn
function onClicked()
local p = game.Players:GetChildren()
for i = 1, #p do
p[i].Character:MoveTo(Vector3.new(0, 500, 0))
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
Aprishiate all help
