#how do I detect when a player is killed with a certain gun

71 messages · Page 1 of 1 (latest)

hollow vessel
#

Title ^

#

All I know is it has something to do with putting a tag on the gun

wide wing
hollow vessel
#

what do you mean by filter? do i just look for the tag on the projectile hit player circuit

#

and thats just if it hits them i want it so it sends a signel when someone is killed

slender eagle
wide wing
#

I don’t even use from rec room object, getting its first tag works fine

hollow vessel
#

i am using a trigger handle and projectile launcher

wide wing
#

Tag the projectile launcher then

hollow vessel
#

ok

slender eagle
#

Sending a signal when someone is killed is by a specfic gun is different

First, you need to find if they are killed, if you have looked at any of my combat help threads, you will know how to do this

But, aswell as sending through the events the Attacker, Defender, and Damage, you will also have to send the Projectile Source through, this way you know who attacked, whos getting attacked, how much damage the defender is taking, and the weapon they are attacked with

hollow vessel
#

so how would i do that

slender eagle
wide wing
#

I looked at none and I got it, am I pro yet

hollow vessel
#

thats all i need

slender eagle
hollow vessel
#

yeah that explains nothing

slender eagle
# hollow vessel yeah that explains nothing

Read any of the times I have helped someone with combat

You have the damage event, Damage Player
It should always contain an Attacker and Defender, and anything else optionally (Like a damage input to choose damage), and in your case, a Projectile Source input from the Projectile Hit Player event

When the event Damage Player is received, do the yada yada whatever with that event, I explained more about in my combat threads, but basically if your health goes equal to or below 0 from this event, you're killed

When the local player is killed, send the event Player Killed to all, containing ofcourse, the Attacker, and you, the defender, aswell as the Projectile Source

tah-dah, you can see when a player was killed and by what

hollow vessel
#

ok thanks

rose portal
slender eagle
rose portal
slender eagle
hollow vessel
slender eagle
hollow vessel
#

ohhhhh im stupid sorry thanks again

#

is it in the configure menu for it

#

nvm i found it

hollow vessel
hollow vessel
#

How do I know what weapon shot the bullet

#

Don’t I need to connect it to the tag on the projectile launcher

#

I explained that poorly one sec

#

wait nvm its a yellow pin

hollow vessel
# slender eagle wdym?

just how do i make it send a show notification when i kill someone only with a spasific custom gun becouse what you have told me is just how to know who and what did it but not how to send a signal when something is killed with the gun

#

thats what im trying to do

#

i might be missunderstanding though

slender eagle
# hollow vessel just how do i make it send a show notification when i kill someone only with a s...

The "How" in this situation is the gun they were killed with

If you know what object they were killed with, you can filter that out using Has Tag, something that will output True if an object has a specific tag
You can configure your object to add this tag, and then make the Has Tag filter for that

(Btw, tags do nothing important to objects, you can delete them if you want, but they can be useful since circuits can detect them)

hollow vessel
#

OHHHHHH im really dumb ok i get it now

#

fr this time

hollow vessel
slender eagle
# hollow vessel final question is there anyway to like move the signal out of the definition boa...

place the event definitions for the events Damage Player and Played Killed outside of the player definition board

Huge mega tip that is litterally always true no matter what you think to anyone of any skill level including me I cannot stress this enough:
NEVER PUT ANYTHING THAT IS NOT AN EVENT SENDER, EVENT RECEIVEE, OR "SELF" CHIP INSIDE THE PLAYER DEFINITION BOARD

saying that in a "trust me I've made this mistake before" way, not a "your stupid for doing this" way

hollow vessel
#

i am now moving all of it

slender eagle
# hollow vessel thank you i just put the whole show notification thing inside the player definit...

The player definition board will be useful in the future, but as of now, its a waste of CPU

The only thing special about it right now is its events, for example, Projectile Hit Player

Projectile Hit Player will fire for the local player in the PDB of the player who gets hit by a projectile when their computer sees the player get hit
"Sight" = "Did the computer register as a hit?"

This event is commonly desynced between players, which is why I always recommend registering it as a hit if the attacker is the one who sees it hit (On receive, if local player is attacker, send event "Damage Player" to everyone with the attacker is local, and the defender as "Self"

hollow vessel
slender eagle
#

Damage Player should have 2 player types, Attacker and Defender, aswell as a Rec Room Object Type as Projectile Source

#

Played Killed should have the same

hollow vessel
hollow vessel
slender eagle
hollow vessel
#

ok

hollow vessel
hollow vessel
slender eagle
hollow vessel
slender eagle
# hollow vessel well for the event definition i do the same thing as the damage player but what ...

Same inputs as damage player

When the event Damage Player is received, check if the defender is local
If the defender is local, take damage

If the damage you take kills you (Health drops equal to or below 0), send the event Player Killed
The attacker is the person who attacked you, the defender is yourself (local player), and the projectile source is the projectile source that shot you (Its the output on the Player Damage event)

hollow vessel
slender eagle
#

If you want RecRoom style health, you use an Int Variable

hollow vessel
#

ok

#

and how would i make that the health of the player

hollow vessel
slender eagle
hollow vessel
slender eagle
hollow vessel