Jump to content

Pickup disappears whenever someone enters it


Cassandra

Recommended Posts

Posted
Ya, you could set the pickup respawn to 0 to make it respawn right after.

Using:

setPickupRespawnInterval 

Aren't there are any alternatives for that? To make a pickup not pickable.

Regards,

Cassandra - V:MP

Posted

Not a good idea, that will cancel the event from being called thus stopping any event triggered when an element hits a pickup.

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

  • Moderators
Posted

I reply this because of andrel his reply. Maybe you want this.

addEventHandler("onPickupHit",root,function(player) 
    local theType = getPickupType ( source ) 
    if theType == 2 then 
        giveWeapon ( player, getPickupWeapon ( source ), getPickupAmmo ( source ), false ) 
    elseif theType == 1 then 
        setPedArmor ( player, getPedArmor ( player ) + getPickupAmount ( source )) 
    elseif theType == 0 then 
        setElementHealth ( player,getElementHealth ( player) + getPickupAmount ( source )) 
    end 
    cancelEvent() 
end) 
  
-- the maximum health is 200 and only able to reach that with full skill level. It will probably set to the highest possible health(depends on the skill level). (armor is 100) 
  

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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