Jump to content

Pickup


Recommended Posts

Posted (edited)

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

76561198387870432.png

ZI ZOMBIE INFECTION: mtasa://5.196.7.163:22003

560x95_FFFFFF_FF9900_000000_000000.png

Posted
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 )

 

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

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?

76561198387870432.png

ZI ZOMBIE INFECTION: mtasa://5.196.7.163:22003

560x95_FFFFFF_FF9900_000000_000000.png

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

Please do not PM me with scripting related question nor support, use the forums instead.

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