Ok, so I went on ROBLOX forums and all I got was people debating what method I use to actually teleport the player, so anyway, what I wanted to do was click a gui named KiritoButton which would take me to a spawn called KiritoSpawn. Here it is:
Player = game.Players.LocalPlayer Spawn = game.Workspace.KiritoSpawn TeleportButton = script.Parent.KiritoButton HasPressedTeleport = false function MouseEnterTeleportButton() TeleportButton.BackgroundColor3 = Color3.new(255,1,4) end function MouseLeftTeleportButton() TeleportButton.BackgroundColor3 = Color3.new(144,144,144) end function TeleportPlayer() if HasPressedTeleport == false then Player.Character:MoveTo(Spawn.Position) end end TeleportButton.MouseEnter:connect (MouseEnterTeleportButton) TeleportButton.MouseLeave:connect (MouseLeftTeleportButton) TeleportButton.MouseButton1Down:connect(TeleportPlayer)
Any help would be greatly appreciated.
EDIT: 18:28:21.963 - Auto-Saving... 18:28:24.160 - Workplace is not a valid member of DataModel 18:28:24.161 - Script 'Players.Player.PlayerGui.LocalScript', Line 1 18:28:24.162 - Stack End 18:28:24.163 - KiritoButton is not a valid member of ScreenGui 18:28:24.164 - Script 'Players.Player.PlayerGui.KiritoButton.Script', Line 3 18:28:24.164 - Stack End
This is the output and it is a normal script.
EDIT 2: I tried using 'spawn' instead of 'Spawn' and nothing happened. I also tried (because the button has a decal on it) putting the script into the image and nothing happened. I even tried making it a local script and still nothing.
for moving the player I would recommend CFrame rather than MoveTo.