local httpService = game:GetService("HttpService")
local PlayerTimes = {}
game.Players.PlayerAdded:Connect(function(player)
httpService:PostAsync("webhook",
httpService:JSONEncode({
content = player.Name .. " has joined the game!"
})
)
PlayerTimes[player] = tick()
end)
game.Players.PlayerRemoving:Connect(function(player)
if PlayerTimes[player] then
print(math.floor(tick() - PlayerTimes[player]))
httpService:PostAsync("webhook",
httpService:JSONEncode({
content = player.Name .. " has left the game. Duration time: " .. math.floor(tick() - PlayerTimes[player])
})
)
end
PlayerTimes[player] = nil
end)
As title said, I want to make webhook text look better. For context, look at screenshot.