Sungmingamerpro13

MainScript Added

Feb 7th, 2026
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.60 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local MessagingService = game:GetService("MessagingService")
  3. local WinManager = require(game.ServerScriptService:WaitForChild("WinManager"))
  4.  
  5. for _, plr in ipairs(Players:GetPlayers()) do
  6.     if plr.Character and plr.Character:FindFirstChildOfClass("Humanoid") then
  7.         local humanoid = plr.Character:FindFirstChildOfClass("Humanoid")
  8.         if humanoid.Health > 0 then
  9.             -- Award this player a win
  10.             WinManager.AwardWin(plr)
  11.         end
  12.     end
  13. end
  14.  
  15. -- Tell lobby servers to refresh their leaderboard
  16. pcall(function()
  17.     MessagingService:PublishAsync("WinsUpdated", {})
  18. end)
Add Comment
Please, Sign In to add comment