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

Place Teleport help?

So i made a GUI that i wanted it to teleport the player whenever its pressed so here is the Script:

player = game.Players.LocalPlayer

script.Parent.MouseButton1Click():connect(function()
	game:GetService("TeleportService"):TeleportToSpawnByName(303813754, "Neutral Spawn", player)
end)

Thanks in advance to whoever helps me

EDIT() I forgot to write what i got in the output ;-;


21:24:48.631 - Players.Player.PlayerGui.ScreenGui.Frame.TextButton.LocalScript:3: attempt to call field 'MouseButton1Click' (a userdata value) 21:24:48.633 - Stack Begin 21:24:48.635 - Script 'Players.Player.PlayerGui.ScreenGui.Frame.TextButton.LocalScript', Line 3 21:24:48.636 - Stack End


1 comment

0

Remove the paranthises next to MouseButton1Click. Connection lines don't require that.

1 answer

✓ Accepted answer

Remove the parentheses before MouseButton1Click and you should be good to go! ^_^

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