Jump to content

onPickupUse/onPickupHit problems


Recommended Posts

local healthPickup = createPickup ( x, y , z, pickupType, amount, respawn ) 

pickup is created fine and when I walk over it , it dissappears and reappears after given respawn time. Like it should. And my health increases of course.

when I hook onPickupUse or onPickupHit (not both at the same time) I run into problems. Tried both.

In the event handler function I sent a msg to the chatbox telling what the user picked up, but I always get two messages like the event was triggered

twice. How is this possible ? Since it dissappears , you shouldn't be able to pick a pickup more than once , right? Until it respawns.

Another thing, first I sat pickupType to integer 0 since I first read this in the wiki for the function createPickup which said an integer value, then I read the wiki for the element Pickup and what I gathered there was

that it was supposed to be set to the string "health".

only difference between those were

first scenario wrote out this...twice: (using pickupType = "health")

"you picked up 100 health "

second scenario wrote out (using pickupType = 0):

"you picked up 100 health" and then "you picked up 0 melee"

What am I doing wrong?


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...