#how do I detect when a player is killed with a certain gun
71 messages · Page 1 of 1 (latest)
If it is a custom gun, tag the projectile gadget, if it is an RRO gun, get first tag and filter from there via the Projectile hit player circuit
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
Projectile hit event does not output a projectile launcher, but instead a "Projectile Source" rec room object IIRC
This means you can find if its the specific object, even if its an RRO gun, with a tag
(If its outputting a Projectile Launcher and not Rec Room Object, you can use From Rec Room Object if you need but I dont think it will make any huge differences)
I don’t even use from rec room object, getting its first tag works fine
i am using a trigger handle and projectile launcher
Tag the projectile launcher then
ok
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
so how would i do that
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
i really wonder
I looked at none and I got it, am I pro yet
yeah cool i know how to know if someones dead but how would i know what gun killed them
thats all i need
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
I really wonder
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
ok thanks
You can get that data from rro weapons?
Projectile Hit Player outputs projectile source
is it bta?
No, its inside the Player Definition Board
i dont see a projectile hit player event or cricket
Projectile Hit Player is found inside the player definition board
ohhhhh im stupid sorry thanks again
is it in the configure menu for it
nvm i found it
But now I have to figure out how to connect that to the projectile launchers and then after send the signal
wdym?
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
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
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)
final question is there anyway to like move the signal out of the definition board or no
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
thank you i just put the whole show notification thing inside the player definition board
i am now moving all of it
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"
wait but then how do i get all of the stuff from the projectile hit player out of the player definition board so i can hook it up to the "has tag" chip
configure event definitions to add datatypes to them
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
are the data types the "add new property" thing or no
yes
so i just make them all the player type
You need 2 player types and 1 rec room object type
ok
so i should call the 2 player types "attacker" and "defender" and the the object type "projectile source"
and also what do i do with player killed
yes
wdym?
What do you do with the event itself, or what do you do to the event definition?
well for the event definition i do the same thing as the damage player but what do i do with the event it self
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)
ok how do i get the health of the defender
A local variable, Health
The reason I never specified a health variable, or damage type, is because what "Health" is is purely up to you
If you want RecRoom style health, you use an Int Variable
do i have to make another event definition
Health would be an Int Variable
but like how would i set the health to the int variable
Subtract
The user takes 10 damage? set Health to Health - 10
no like how do i make the ink variable and the health the same