Advertisement
OnFireRobloxScriptin

Teleport Player Script (Text Button)

Aug 12th, 2023
5,837
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. --//Variables
  2. local TeleportService = game:GetService("TeleportService") --Gets the TeleportService from the Game
  3. local gameId = 12109044833 --Replace the numbers with the PlaceId of your game
  4. local player = game.Players.LocalPlayer --Gets the player
  5. local db = true --Debounce/Cooldown
  6.  
  7. --//Teleport
  8. script.Parent.MouseButton1Click:Connect(function() --Fires Event when button is clicked
  9.     if db then --If debounce then
  10.         db = false --Sets debounce to false
  11.         TeleportService:Teleport(gameId, player) --Teleports player to the Game
  12.         task.wait(1) --Wait 1 second
  13.         db = true --Sets debounce to true
  14.     end
  15. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement