I’ve been working on a Fallout game for a few months now, and I plan to use normal weapons (paint burst rifle, laser pistol, etc.) and custom weapons with a gun handle, which allows me to use custom models, and a reload to the gun. However, when I published the game for testing, I noticed that people would get hurt from their own bullets from the custom weapon? Does someone know how to fix this, or is it just a bug?
Usually in your PVP system you can easily fix this by finding the projectile hit player event and putting it through a equals chip with both ports being the shooting player and the hit player and then a if chip
In other words, the equals chip detects if the person holding the trigger handle is the same as the projectile hit player, and you can wire that into the bool of an “if” chip which will allow you to use the “else” port and avoid taking damage from yourself
I’m trash with circuits, but I think I’m able to do it with this context. Thank you guys so much!
I got the equals chip working, but I don’t know what to do with the Equals and If chip together
Wherever your system registers damage, put that if chip before it does the damage, it should prevent the shooting player from harming themselves.
I got it figured it. Thanks everyone
Try this, my dude
-
Use the Equals Chip:
-
Add an “Equals” chip to your circuit.
-
Connect the “Shooter” output of the projectile launcher to one input of the “Equals” chip.
-
Connect the “Hit Player” output of the projectile hit event to the other input of the “Equals” chip.
-
Add an If Chip:
-
Add an “If” chip to your circuit.
-
Connect the output of the “Equals” chip to the condition input of the “If” chip.
-
Prevent Self-Damage:
-
Connect the “Else” output of the “If” chip to the damage-handling part of your circuit. This ensures that damage is only applied if the shooter and the hit player are not the same.
i appreciate you so much bro, but i need to know a few things: am i supposed to edit the projectile launcher and do all this, and what is the “damage-handling” part of the circuit?
If someone could just explain this really well or just send a picture, that would help a lot. I have a game coming up in January and I really need this