Jump to content

Pickup Attachments


Byronity

Recommended Posts

The problem is that no matter what i do, i can't get the pickup to attach to the player. The pickup is created but it doesn't attach before i change my skin.

And is there a way to disable to pick up the pickups? because whenever they are created, they are consumed by the player.

(The pickup is too close to the player upon the attachment and thus is consumed by the player upon attachment)

local pickup = {}   
addEvent("createPickup",true) 
addEventHandler("createPickup",root, 
function (client, icon) 
    if isElement(pickup[client]) then destroyElement(pickup[client]) end 
    local x, y, z = getElementPosition(client) 
    pickup[client] = createPickup(x, y, z, 3, tonumber(icon)) 
    if pickup[client] then
    attachElements(pickup[client], client, 0, 0, 1.5) 
   end 
end) 

 

Link to comment

I tried that actually but it's not as stable as attachElements. Do you have any other ideas? Afaik, i can't disable the ability to pick up the pickups, so if i can't find another solution, i might recreate the script, create the pickups as objects, disable the collisions and rotate it to create the illusion of the pickup. 

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