local clickDetector = workspace.button.ClickDetector local clicked = false function onClicked(player) if not clicked then clicked = true if player.Character then player.Character:MoveTo(Vector3.new(-11, -1.9, -16.45)) end end end else clicked = false if player.Character then player.Character:MoveTo(Vector3.new(-27.2, 0.5, 15.5)) end end script.Parent.ClickDetector.MouseClick:connect(onClicked)
i am mindboggled as to why its not working but if anyone can help would be heavily appriciated!
G'day!
You did a small mistake in the script, so here is the fixed one:
local clickDetector = workspace.button.ClickDetector local clicked = false function onClicked(player) if not clicked then clicked = true if player.Character then player.Character:MoveTo(Vector3.new(-11, -1.9, -16.45)) end else clicked = false if player.Character then player.Character:MoveTo(Vector3.new(-27.2, 0.5, 15.5)) end end end script.Parent.ClickDetector.MouseClick:connect(onClicked)