1LoL1 Posted October 4, 2015 Share Posted October 4, 2015 Hello can anyone help me with my code please? how i can pickup respawn for 5 seconds? local pickup = createPickup(x,y,z,3,id,3) function gift (thePlayer) test end addEventHandler ( "onPickupUse", pickup, gift ) Link to comment
CobbTheWarriorsRPG Posted October 4, 2015 Share Posted October 4, 2015 Something like this? function SpawnPicks ( ) if ( not pickup ) then pickup = createPickup(x,y,z,3,id,3) addEventHandler ( "onPickupHit", pickup, onPickupHit ) end end addEventHandler ( "onResourceStart", resourceRoot, SpawnPicks ) function onPickupHit ( ) if isElement ( pickup ) then destroyElement ( pickup ) setTimer ( function() SpawnPicks() outputChatBox ( "Pickup created" ) end, 5000, 1 ) end pickup = nil end Link to comment
1LoL1 Posted October 4, 2015 Author Share Posted October 4, 2015 Something like this? function SpawnPicks ( ) if ( not pickup ) then pickup = createPickup(x,y,z,3,id,3) addEventHandler ( "onPickupHit", pickup, onPickupHit ) end end addEventHandler ( "onResourceStart", resourceRoot, SpawnPicks ) function onPickupHit ( ) if isElement ( pickup ) then destroyElement ( pickup ) setTimer ( function() SpawnPicks() outputChatBox ( "Pickup created" ) end, 5000, 1 ) end pickup = nil end No but thanks and my problem is solved. I used this and work. local pickup = createPickup(x,y,z,3,id,5000) function gift (thePlayer) test end addEventHandler ( "onPickupHit", pickup, gift ) Link to comment
CobbTheWarriorsRPG Posted October 4, 2015 Share Posted October 4, 2015 Ok!, your welcome 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