So basically I just wanted to know how I would do this. Currently, I have a boss, and I want to be able to give the players a reward, however, it only gives the reward to whoever kills it. I want to make it where if everybody does enough damage then they will also get the reward.
This is what I Currently have.
script.Parent.Humanoid.Died:Connect(function()
local tag = script.Parent.Humanoid:FindFirstChild("creator")
if tag ~= nil then
local player = tag.Value
if player ~= nil then
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + 1000
wait(0.1)
end
end
end)
This would be handled by the weapon code. Whenever a player makes an attack against the boss calculate the damage and add it to a running counter for that boss. Then, when the boss dies, check this value.