Advertisement
AERQ1111

ROBLOX Simple Rejoin Script

Apr 4th, 2025 (edited)
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. -- Script to rejoin the server you're currently in.
  2. local teleportService = game:GetService("TeleportService")
  3. local players = game:GetService("Players")
  4. local player = players.LocalPlayer
  5.  
  6. local function rejoinServer()
  7.     local serverId = game.JobId -- Gets the current server's ID
  8.     teleportService:TeleportToPlaceInstance(game.PlaceId, serverId, player)
  9. end
  10.  
  11. -- Example: Rejoin when pressing "P"
  12. local userInput = game:GetService("UserInputService")
  13.  
  14. userInput.InputBegan:Connect(function(input, gameProcessed)
  15.     if not gameProcessed and input.KeyCode == Enum.KeyCode.P then -- Keybind to Rejoin (Original: "P")
  16.         print("[INFO] Rejoining same server...")
  17.         rejoinServer()
  18.     end
  19. end)
  20.  
  21. print("[INFO] Press 'P' to rejoin the same server!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement