OnPlayerTakeDamage
#1

How not to lose health with OnPlayerTakeDamage?

I intended to play with the "amount" value, but for example if the player has 10 HP before being shot I can not reget him the value of amount , eg amount = 50 ... if he does not regain 10 HP .

++
Reply
#2

return false
Reply
#3

I don't know why you think returning 0(or false) will stop the damage from being taken, it won't. It will stop the callback from being called in other scripts.
Reply
#4

Use OnPlayerWeaponShot()

PHP код:

public OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{
     
// Your code here
     
return 0//Prevents the player from taking damage.

Reply
#5

Quote:
Originally Posted by Abagail
Посмотреть сообщение
I don't know why you think returning 0(or false) will stop the damage from being taken, it won't. It will stop the callback from being called in other scripts.
ah, my mistake
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)