this is my script
local tele = workspace.Teleports.SuperMan local x = tele.Position.x local y = tele.Position.y+5 local z = tele.Position.z script.Parent.MouseButton1Down:connect(function() (Player Goes Here).HumanoidRootPart.CFrame = CFrame.new(x,y,z) end)
it is inside a surface gui and it doesn't work in a local script some reason
LOL. I also had this problem a while ago, anyway... Here's the answer (it is well-commented :D):
==================================
Make a localscript in the surface GUI (NOT IN THE BUTTON). Type the following in:
wait(1) script.Parent.Adornee = -- FULL LOCATION OF THE PART WHERE YOU WANT THE BUTTON TO BE -- This just makes it so it will show up on the part (you will put the surface gui in starterGUI) --- local tele = workspace.Teleports.SuperMan local x = tele.Position.x local y = tele.Position.y+5 local z = tele.Position.z local player = game.Players.LocalPlayer -- Sets the localplayer buttonnamelolidk.MouseButton1Down:connect(function() -- Put the full location of the button where buttonnamelolidk is player.Character.HumanoidRootPart.CFrame = CFrame.new(x,y,z) -- Teleports the player end)
Put the surface GUI in StarterGUI
** TIP: If the button still does not show, try rotating the part. **
Try puting the SurfaceGui in the StarterGui and putting the SurfaceGui's Adornee to the part of where the surfacegui was before u put it in startgui