Alright, so this is more of a question about the way to have a system where if I click a GUI, it'll teleport a player to another place in the universe. I've looked up the teleport system on the wiki, but the help they provided didn't help, let me specify.
The script I'm using:
local me = player.PlayerGui.ScreenGui.Start
function onClicked
local player = game.Players:GetPlayerFromCharacter(click.Parent)
if player then
game:GetService("TeleportService"):Teleport(player, 31355192)
end
end
me.MouseButton1Click:connect(onClicked) --added this part in so you knew I got this down already.
That teleport code came from the number ID on the place, I don't know if this was even the right set of numbers though (Picture link) http://prntscr.com/8gsv9x
If you need to know anything else, just tell me.
THIS EVENT IS BEING FIRED BY CLICKING A GUI BUTTON

10 comments
Dude it's not :Teleport(31355192, player) It's Teleport(player, 31355192
A small mistake like that is nothing to downvote someone on.
Fine I didn't down vote.
Thanks for the catch.
Thanks for helping so far, but now I get an error message in the developer log saying this:
"Unable to cast Instance of int" (next line under) I know this is the problem because under it, it shows that it came from that script on the "game:GetService" line (I've added just a little more to the original question to help)
Try switching around the "player" and the number, I think duckyo01 might have been wrong.
Also, if this is in a LocalScript, :Teleport() automatically sends the player. No need to add 'player', just :Teleport(id)
I still got the same error when I did both of those ideas.
I'm not sure if this matters, but it's being fired by clicking a GUI Button