I've looked at Youtube videos to try to help me in my struggle, and use their scripts, but none of them are working. Please help!
It'd probably go something like this, maybe it'll help you understand?
-- Declare a position to teleport to local TeleportPos = Vector3.new(0, 5, 0) local Btn = script.Parent -- Declare a variable for the button Btn.ClickDetector.MouseClick:connect(function(PlayerWhoClicked) -- Teleport the Character of 'PlayerWhoClicked' to the Teleport Position 'TeleportPos' PlayerWhoClicked.Character:MoveTo(TeleportPos) end)
Maybe use the MoveTo function?
Something like
function tpPlayer() however.You.Find.LocalPlayer:MoveTo(x, y, z) -- Idk how to find players on clicks; I'm not good with tables or GetChildren for the matter end script.Parent.ClickDetector.MouseClick:connect(tpPlayer) --assuming the script is within the button and there is a ClickDetector in it
This is really crappy code though. I made it on an iPad at school :P