Remove Weapon [help]

so far i have this… i want the weapon to be removed once a player enters…

if (playerenters&&weapon=Draisine){ message Your Draisine Will Be Removed! }
i tryed different stuff and it didnt work

triggeraction gr.deleteweapon Draisine; or something like that. Try adding 0,0 if it requires more parameters

if (playerenters&&hasweapon(Draisine)){ say2 Your Draisine Will Be Removed!; triggeraction 0,0,gr.deleteweapon,Draisine; }
or something like that.

I prefer using destroy through a call method to delete weapons. The downside of this is that you need the method defined in the weapon before hand.
So the solution becomes


if (playerenters){
  toweapons hopes;

if (destroyWeapon){

And the script to remove the weapon is:

if (playerenters || playerdoessomething){
  for (this.i = 0;this.i<weaponscount;this.i++)
    if (strequals(#w(this.i),hopes))
      callweapon this.i,destroyWeapon,;

I think it’s cute, the way you over complicated things.

How can a number equal hopes, tricxta?

edit: nvm that’s a fuckin w, Tricxta’s is how I would do it.

hmmm doesn’t seem to be working for some reason. It has no errors, but still wont remove it. hmmm i wonder why not.

You are using the triggeraction?
You should probably check this line in serveroptions.txt:

Enables triggeraction hacks.

triggerhack_weapons = false# gr.addweapon, gr.deleteweapon
Mine is false, but I don’t remember if it was my choice or the default.

i forgot to mention that this is for offline editor :slight_smile:

Did you just copy and paste Tricxta’s code? You’ll need to change some code. Most likely just the weapon name “hopes” to “Draisine” in both codes (or whatever you choose to call your draisine weapon). Also, probably should take out playerdoessomething. It works for me.

Also, if it wasn’t painfully clear, the first of Tric’s code goes in the Draisine weapon and the second code goes in a NPC the room where you want the Draisine disabled.

now you’re just playin’ dirty with us

I know that! I dont Copy and Paste Stuff without changing the info to match mine. but it still doesnt work ^^[COLOR=“Silver”]

---------- Post added at 03:24 PM ---------- Previous post was at 03:23 PM ----------


Sorry :’(