How do i give points to multiple players after survivng a round
i managed to get the singular player one right but i am having trouble doing the multiple players one.
If you have any advice or solutions, feel free to put them down below, it would really help me out
thank you!
here is the part of the code i am having trouble with
if #survivors:GetChildren() == 0 then
status.Value = "Nobody Survived"
-- this one is fine ^
elseif #survivors:GetChildren() > 1 then
status.Value = "Multiple Survivors"
local plrs = game.Players:GetPlayerFromCharacter(survivors:GetChildren())
local leaderstats = plrs:FindFirstChild('leaderstats')
leaderstats.Survivals.Value = leaderstats.Survivals.Value + 1
leaderstats.Points.Value = leaderstats.Points.Value + 10
-- this one i am having trouble with ^
elseif #survivors:GetChildren() == 1 then
status.Value = workspace.InRound:FindFirstChildWhichIsA("Model").Name.." Survived"
local plr = game.Players:GetPlayerFromCharacter(workspace.InRound:FindFirstChildWhichIsA("Model"))
plr.leaderstats.Survivals.Value = plr.leaderstats.Survivals.Value + 1
plr.leaderstats.Points.Value = plr.leaderstats.Points.Value + 10
-- this one is also fine