This commit is contained in:
I-Have-An-Issue 2023-02-12 21:53:23 -05:00
parent 3204aede8a
commit 75eacef99f
No known key found for this signature in database
GPG Key ID: E55435DEA0825091
1 changed files with 19 additions and 6 deletions

View File

@ -31,12 +31,25 @@ function update(LeavingPlayer)
end end
function keepAlive(LeavingPlayer) function keepAlive(LeavingPlayer)
game:GetService("HttpService"):PostAsync("https://dungblx.cf/API/KeepAlive", game:GetService("HttpService"):JSONEncode({ local success, result = pcall(function()
["ServerIP"] = jobId, game:GetService("HttpService").HttpEnabled = true
["PlaceId"] = game.PlaceId,
["PlayerCount"] = #game:GetService("Players"):GetPlayers(), local body = game:GetService("HttpService"):JSONEncode({
["PlayerList"] = update(LeavingPlayer), ["ServerIP"] = jobId,
})) ["PlaceId"] = game.PlaceId,
["PlayerCount"] = #game:GetService("Players"):GetPlayers(),
["PlayerList"] = update(LeavingPlayer),
})
game:GetService("HttpService"):PostAsync("https://dungblx.cf/API/KeepAlive", body)
end)
if not success then
local message = Instance.new("Message")
message.Text = "Ping Error: " .. result
message.Parent = workspace
game:GetService("Debris"):AddItem(message, 5)
end
end end
-----------------------------------END UTILITY FUNCTIONS ------------------------- -----------------------------------END UTILITY FUNCTIONS -------------------------