Hi everyone, I need a little help with one script.
For some reason, the script gives a badge to only one random player.
the script:
local Players = game:GetService("Players")
local Humanoid = script.Parent:WaitForChild('Humanoid')
BadgeID = 2124785121`
Humanoid:GetPropertyChangedSignal("Health"):Connect(function(value)
if Humanoid.Health <= 0 then
for i, v in pairs(game:GetService("Players"):GetPlayers()) do
BadgeService:AwardBadge(v.UserId, BadgeID)
end
end
end)
What I gave were potential fixes, as my practical experience with scripting is quite small.
Can you try printing out the UserId of each player to see if it iterates through all players? (it should, which by the way you have an unused reference to Players already, use that)