-
-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add onElementHealthChange & onClientElementHealthChange events #3278
base: master
Are you sure you want to change the base?
Conversation
#3152 duplicate |
I should have looked up before starting it.. |
Sure, it might be a duplicate, but I can see that the health status is updated through the packet - that's actually a good idea. My PR has been abandoned... I don't think I even have local access to it (it's actually on the cloud and rotting). |
I have run some test cases. The event is only triggered through function setElementHealth. Generally, we would like the event to be triggered in any case of health change. |
Tbh we got already (on[client]PlayerDamge) on[client]VehicleDamge, So I dont think adding it would be nice |
No, no... These events must stay. I'll allow myself to quote Lpsd comment from my PR.
|
It's such a nice thing.. but why? |
The events you've mentioned are meant only for streamed players/vehicles. Why exactly it should be as znvjder explained above? To avoid shenanigans of using extra logic, from event you'd expect to cover any health change, in any case. Otherwise it will be very inconvenient for scripter. Removing them doesn't make sense, as they have different purpose - either tweak how it works, disable damage or completely overhaul it. |
well i'll start rn with it doing what you want |
I believe it will only be server-side events. Otherwise, client-side damage is challenging to work with. I have tried everything in |
You could do a check each frame perhaps. |
Any updates on this? |
No, somehow I can't do it... I've tried it in various ways, but there are so many FPS drops when a PLAYER got health changed. Maybe I'll close it, hoping that next time someone with more experience will make better one. 👍 |
New health events onElementHealthChange & onClientElementHealthChange
Features:
Server-Side Event:
onElementHealthChange
source
: The affected element.arg1
: Old health value.arg2
: New health value.client
(optional): The client responsible for the change (if initiated from the client side).Client-Side Event:
onClientElementHealthChange
source
: The affected element.arg1
: Old health value.arg2
: New health value.Example Usage: