So, I've done it before with a part touch, now I'm trying to make a GUI button teleport you to a different game, I tryed changing the part touch script teleport to work for a GUI button click instead, so I made this but it didn't work:
function onTouched(click)
local player = game.Players:GetPlayerFromCharacter(click.Parent)
if player then
game:GetService("TeleportService"):Teleport(228755269, player)
end
end
script.Parent.MouseButton1Click:connect(onTouched)
Help me?...

2 comments
You're welcome!
i'm looking to have a teleport, and this doesn't work (it has a loading GUI). The loading GUI is in ServerStorage. It is a LocalScript.