Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Place Teleport help?

Asked by 9 years ago

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


0
Remove the paranthises next to MouseButton1Click. Connection lines don't require that. obcdino 113 — 9y

1 answer

Log in to vote
0
Answered by
Spooce 78
9 years ago

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

Ad

Answer this question