I know you have to do something like check if the damage thing kills the player but I don't get it can someone please give me example script that will help thank you
so on the part where it says
hum:TakeDamage(Damage)
i put
if hum.Health - Damage <= 0 then
hum:TakeDamage(Damage)
game.Players.LocalPlayer.leaderstats.Points.Value =
game.Players.LocalPlayer.leaderstats.Points.Value + 100
end
pls tell me for some reason it not work can you tell me how the right way is
game.Players.PlayerAdded:Connect(function(char) stats = Instance.new("IntValue") stats.Name = "leaderstats" stats.Parent = char d = Instance.new("IntValue") d.Name = "Deaths" d.Parent = stats d.Value = 0 end) while wait() do for _,p in pairs(game.Players:GetPlayers()) do if p.Character.Humanoid.Health == 0 then local ls = p:FindFirstChild("leaderstats") local dth = ls:FindFirstChild("Deaths") dth.Value = dth.Value + 1 end end end
OMG GUYS I FIXED IT ALL I NEEDED TO DO WAS MAKE IT TO A LOCAL SCRIPT thanks
i think i had same problem always with me lol