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)