Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- put this in your autoexecute folder
- local range = 5 -- set range for the minutes it goes back, example: if you put to 10 then it will find a server with chaka spawning in 10 minutes
- if game.PlaceId == 8540168650 then
- game.Workspace:WaitForChild("Age",math.huge)
- local mins = string.sub(tostring(game.Workspace.Age.Value/(60*60)),2)*60
- print(mins)
- print(mins > 30,mins < 60-range,mins < 30-range)
- if mins > 30 and mins < 60-range or mins < 30-range then
- print("TELEPORTING")
- local servers = {}
- local serverstorage = game:GetService("HttpService"):JSONDecode(request({Url = string.format("https://games.roblox.com/v1/games/%d/servers/Public?sortOrder=Asc&limit=100", game.PlaceId)}).Body).data
- for i,v in pairs(serverstorage) do
- if v.id and v.id ~= game.JobId and tonumber(v.playing) < tonumber(v.maxPlayers) then
- table.insert(servers,v.id)
- end
- end
- game:GetService("TeleportService"):TeleportToPlaceInstance(game.PlaceId,servers[math.random(1,#servers)],game.Players.LocalPlayer)
- else
- print("SERVER FOUND!!!")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement