TorNix~|nR Posted July 27, 2017 Share Posted July 27, 2017 (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 July 27, 2017 by TorNix~|nR Link to comment
TorNix~|nR Posted July 27, 2017 Author Share Posted July 27, 2017 Guys, any helps please? Link to comment
Zorgman Posted July 27, 2017 Share Posted July 27, 2017 Try addEventHandler ( "onPickupHit", root, aa ) 1 Link to comment
DNL291 Posted July 27, 2017 Share Posted July 27, 2017 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 ) 1 Link to comment
TorNix~|nR Posted July 27, 2017 Author Share Posted July 27, 2017 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
DNL291 Posted July 28, 2017 Share Posted July 28, 2017 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. 1 Link to comment
TorNix~|nR Posted July 28, 2017 Author Share Posted July 28, 2017 Guys, it works, thank you so much Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now