Jump to content

Pickup


Recommended Posts

Hello guys, I have a problem on my script, the first pickup worked, but the second is not working, also I'm gonna add more, so I need help please? 

local aPickup = createPickup ( -2661.68, 627.43, 14.45, 3, 1239, 1000 ) and createPickup ( -2657.33, 631.34, 14.45, 3, 1239, 1000 )

function aa ( source )
cancelEvent()
outputChatBox("test", source, 0, 255, 255, true)
end
addEventHandler ( "onPickupHit", aPickup, aa )

 

Edited by TorNix~|nR
Link to comment
8 hours ago, TorNix~|nR said:

 


createPickup ( -2661.68, 627.43, 14.45, 3, 1239, 1000 ) and createPickup ( -2657.33, 631.34, 14.45, 3, 1239, 1000 )

 

That's wrong. It should be this way:

local pickupA = createPickup ( -2661.68, 627.43, 14.45, 3, 1239, 1000 )
local pickupB = createPickup ( -2657.33, 631.34, 14.45, 3, 1239, 1000 )

You can also do like this:
 

local pickupA, pickupB = createPickup ( -2661.68, 627.43, 14.45, 3, 1239, 1000 ), createPickup ( -2657.33, 631.34, 14.45, 3, 1239, 1000 )

 

  • Like 1
Link to comment

this works

2 hours ago, Zorgman said:

Try


addEventHandler ( "onPickupHit", root, aa )

 

but there is a little problem, it makes it for all pickups, even on other scripts, I have other pickups for example of wanted level, all pickups become that text

Help?

Link to comment
2 hours ago, TorNix~|nR said:

this works

but there is a little problem, it makes it for all pickups, even on other scripts, I have other pickups for example of wanted level, all pickups become that text

Help?

Use resourceRoot instead of root and it should work.

  • Like 1
Link to comment

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...