Advertisement
Joriangames

Teleport Button localscript

Jan 15th, 2024 (edited)
1,180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. -- How To Make TELEPORT BUTTON in Roblox Studio!!! BY BLOXIANCODE youtube.com/c/BloxianCode
  2. -- Tutorial: https://youtube.com/shorts/6q3Rn8rYTXw
  3. local toggle = script.Parent.Toggle
  4.  
  5. local button = script.Parent.Frame.TextButton
  6. local teleporTo = game.Workspace.teleportTo
  7. local player = game.Players.LocalPlayer
  8.  
  9. toggle.MouseButton1Click:Connect(function()
  10.     if script.Parent.Frame.Visible == true then
  11.         script.Parent.Frame.Visible = false
  12.     else
  13.         script.Parent.Frame.Visible = true
  14.     end
  15. end)
  16.  
  17. button.MouseButton1Click:Connect(function()
  18.     local humR = player.Character.HumanoidRootPart
  19.     humR.CFrame = teleporTo.CFrame
  20. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement