Jump to content

Disable pickups


Compa

Recommended Posts

Hey Guys,

I'm trying to disable pick-ups but it isn't working

function disablepickups() 
  
    pickups = getElementsByType("repair") 
    for i,v in ipairs(pickups) do 
        destroyElement(v) 
    end 
     
end 
  

Does someone know i'm doing wrong here?

Link to comment
That doesn't work.

I'm using a commandhandler

addCommandHandler("testing", disablepickups) 

function disablepickups(repair) 
    if  (getElementsByType(repair) == "pickup") then 
    for _,v in ipairs(repair) do 
        destroyElement(v) 
        end 
   end 
end 
addCommandHandler("testing", disablepickups) 

Link to comment
function disablepickups(_,_,pickupType) 
    local racePickups = getElementsByType( "racepickup" ); 
    for _,v in ipairs(racePickups) do 
        if getElementData( v, "type" ) == pickupType then -- skip this statement if you want to remove all race pickups 
            destroyElement(v) 
        end 
   end 
end 
addCommandHandler("testing", disablepickups) 
  
-- /testing repair 

EDIT:

Sorry, haven't read your last post.

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