Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Universe Problem, only works in Test mode!?

This script seems easier than it is to generate. Sadly I have yet to find the full problem.

function OnClick(mouse)
game:GetService("TeleportService"):Teleport(259945232)

end

script.Parent.ClickDetector.MouseClick:connect(OnClick)

It is in a normal script, I've tried it in a Local and it failed as well. Any suggestions?

1 answer

✓ Accepted answer

You have to tell the function who it's teleporting

We can do this easily, because ClickDetectors give us the player who clicked. In Local Scripts we don't need to do this, but in regular scripts we do.

-- Regular Script
function OnClick(plr)
	game:GetService("TeleportService"):Teleport(259945232,plr)
end

script.Parent.ClickDetector.MouseClick:connect(OnClick)

Good Luck!

If I helped, please don't forget to accept my answer.

2 comments

0

How did you make the text smaller?

0

Use Hashtags. I used 6. One # is huge, 6 is small.

This discussion is preserved as it was. New answers, comments, and votes are closed.