Jump to content

Is it possible for a weapon script to identify who is using it?


RetroNutcase

Recommended Posts

Me again, full of questions. This'd be easier if the chat actually had people that do modding and know their stuff in it more often, but that's neither here or there.

 

What I basically need to know is this: is it possible to get a referenceID off someone via a weapon script? One of my custom ammo types has required me to add a scripted effect to the weapon, and I have it partially working. The only problem is I don't know how to determine, when this script runs, is who is currently firing said weapon. If I kept it as is, it could theoretically work at times I don't want it to. Perhaps if I show my script (relatively simple one) it'll make more sense.

 

ScriptName UraniumEffectScript

Begin OnFire
if GetEquipped Ammo50mgDepletedUranium==1
placeatme UraniumRadiationBurst
endif
End

Basically, the idea is, if the user of an Anti Materiel Rifle uses Depleted Uranium rounds, a small radioactive burst should be placed at their location, causing them (and anyone near them) to have their radiation level increase. I know the placeatme idea works, because I just confirmed it by making myself explode in a fiery fatman explosion upon firing the weapon. This however, was done when I set the reference in the script to the player. Obviously, for this to work right, I need the weapon to identify who is firing it, so it can check their equipped ammo type and if it's Depleted Uranium, create a Radiation Burst effect on the player.

 

Is this possible?

Link to comment
Share on other sites

What are you attaching this script to? Something basic to check first too, would be trying the placeatme UraniamRadiationBurst in-game to ensure your explosion is doing as intended.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...