As far as I did is this raw script, but the main question how would it work with 0 players playing your game?
local HttpService = game:GetService("HttpService")
local WebhookURL = "YOUR WEBHOOK URL HERE"
-- Function to send message to Discord using webhook
local function sendMessageToDiscord(message)
local data = {
["content"] = message
}
local requestBody = HttpService:JSONEncode(data)
HttpService:PostAsync(WebhookURL, requestBody)
end
-- Function to get the number of players that have joined the game
local function getNumberOfPlayers()
return #Players:GetPlayers()
end
-- Send hourly update on the number of players that have joined the game
while true do
local numberOfPlayers = getNumberOfPlayers()
local message = "Hourly update: " .. numberOfPlayers .. " players have joined the game."
sendMessageToDiscord(message)
wait(3600) -- wait for one hour
end