Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Script to rejoin the server you're currently in.
- local teleportService = game:GetService("TeleportService")
- local players = game:GetService("Players")
- local player = players.LocalPlayer
- local function rejoinServer()
- local serverId = game.JobId -- Gets the current server's ID
- teleportService:TeleportToPlaceInstance(game.PlaceId, serverId, player)
- end
- -- Example: Rejoin when pressing "P"
- local userInput = game:GetService("UserInputService")
- userInput.InputBegan:Connect(function(input, gameProcessed)
- if not gameProcessed and input.KeyCode == Enum.KeyCode.P then -- Keybind to Rejoin (Original: "P")
- print("[INFO] Rejoining same server...")
- rejoinServer()
- end
- end)
- print("[INFO] Press 'P' to rejoin the same server!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement