SO basically, in my gun I check if the health is (less than) or 0 and if it is I award them points etc.
For some reason it works some times, and not others. It is really annoying and confusing!
Any ideas why it randomly works?
Thanks!
This is HitHumanoid
if FindFirstClass(HitObj.Parent, "Humanoid") then
HitHumanoid = FindFirstClass(HitObj.Parent, "Humanoid")
end
FindFirstClass checks what it hits :)
if HitHumanoid.Health <= 0 then
game.Players.LocalPlayer.ShotsFired.Value = game.Players.LocalPlayer.ShotsFired.Value + 1
game.Players.LocalPlayer.XPEarned.Value = game.Players.LocalPlayer.XPEarned.Value + 20
game.Players.LocalPlayer.CoinsNeeded.Value = game.Players.LocalPlayer.CoinsNeeded.Value + 20
gotkill()
end

6 comments
There isn't an apparent problem in that snippet of code. Maybe it has something to do with how you are getting HitHumanoid.
Well, I get no errors in the output :/ - and it works sometimes!
Can we see more anyways, just in case?
Yeah! I edit it :)
I wouldn't recommend editing all of these values in a LocalScript either way. Move your logic to the server and maybe you'll find out what's up whilst you're at it.
I've noticed that this problem occurs when there is server lag (And not in a baseplate). Any ideas why?