#How to make a PvP damage/health system
1 messages · Page 1 of 1 (latest)
its really simple, ı made a gloable variable to manage every characters weapons, if the player selects "gun number 2" instead of "gun number 1" then the characters checks what the varible is currently and adjusts to that,changing the damage, loading the correct gun model etc.
Not enough info to go off of. I mean, hurting an enemy can be as simple as health -= damage, but I'm guessing you want something a bit more complex than that. Perhaps if you give an idea of what you've got at the moment, and what you're aiming for people can help you better.
I'm not sure whether you're using Godot's built in replication system, or a custom dedicated server.
If you're using custom dedicated I would implement it like this:
- player A shoots at player B
- player A tells server that he has done so, and which part of the body was hit
- server makes sure that it's currently possible to be true (I.e. Close enough, etc.)
- server calculates damage
- server tells player B that player A has hit him with a certain gun on a certain body part for a certain amount of damage
- player B replicates the damage on itself
Yes this is exactly what I’m trying to do
The second one
Where a shots b with a specific gun and then b takes damage according to the gun