the problem is that this is done by onClientClick in my script
-- Client
function takeBox(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, element)
if element and getElementType(element) == "object" and button == "left" and state == "down" then
local x, y, z = getElementPosition(localPlayer)
local x1, y1, z1 = getElementPosition(element)
local distance = getDistanceBetweenPoints3D(x,y,z,x1,y1,z1)
if distance < 3 then
if getElementModel(element) == 2969 then
setElementData(localPlayer, "boxes", boxes+1)
destroyElement(element)
end
end
end
end
end
How to destroy this element for all players