remoteFolder.damageinflicted.OnServerEvent:Connect(function(inflicter,reciever,amount)--inflicter = player instance, reciever = character model
reciever.Humanoid.Health -= amount
if reciever.Humanoid.Health <= 0 then --this doesn't work?
inflicter.leaderstats.elims.Value += 1
The remote event, parameters, and health deduction all work perfectly. However, for some reason the if statement doesn’t fire whenever the reciever’s health equals or goes below 0 from the previous line
If I could get some help with this that’d be great ;]
The only reason why the if statement won’t run is because the logic is false. And the only reason why the logic would be false is because the player’s health isn’t actually at or below 0, indicating that the player was never killed, which is why I draw the conclusion that your method of inflicting damage is NOT GOOD
^You can see both clients and the server see the damage. No replication issues…
I don’t know why you don’t believe me when I say the damage infliction works. Stop being a jerk about it too. The logic isn’t “false”. And it’s not “my method”, I’m curious as to why Humanoid.Health <= 0 doesn’t work
I’m not being a jerk, I’m literally explaining to you why the if statement fundamentally doesn’t work, which IS because the logic is false, BECAUSE the player’s health literally isn’t at or below 0
What I’m saying is that the if statement should and only should run when the player dies. Yes, in that screenshot, that other player took damage but he didn’t die! So can you check to see what happens when you kill him?