Alright, Before you say, Oh its easy, just type in command bar, I'm Trying to teleport the player (Note this is a 1 player lobby place) To the place once they click play (This is a guibutton!), Heres what ive tried (I'll explain more after)
1 | local tps = game:GetService( "TeleportService" ) |
2 | script.Parent.MouseButton 1 Down:connect( function () -- New function |
3 | tps:Teleport( 8473728 , game.Players:GetChildren()) --This is just a example, it does not teleport to the place i want it to yet |
4 | end ) --Ends the function (Note that the connect is at the beginning.) |
Alright, Assigning tps just makes game:GetService("TeleportService"):Teleport(8473728, game.Players.LocalPlayer) shorter Now the :connect, connects the function once the button is pressed, Uh okay, Please answer, (I am not a real noob in roblox, im just using my alt) I've tried the script alot, it wont work for some strange reason. ServerScript Log:
PlayerError: LocalPlayer Is not parent of game.Players (Note that i shortened that to make you understand it easier)
Put this in a LocalScript if it's a one player server so you don't need the second parameter.
tps:Teleport(8473728)
would be all that you need.