Jump to content

[HELP]Object detach


DzMG-LV

Recommended Posts

Posted

So i made pizza delivery script.

Object attach's why it don't work's when i try to destroy it?

code:

  
function pizzaHand() 
local pizza = createObject ( 1271, 0, 0, 0 ) 
exports.bone_attach:attachElementToBone(pizza,source,12,0.081,0.05,0.01,0,-70,0) 
end 
addEvent("addPizza", true) 
addEventHandler("addPizza", root, pizzaHand) 
  
function destroyPizza() 
destroyElement(pizzaHand) 
end 
addEvent("destroyPizza", true) 
addEventHandler("destroyPizza", root, destroyPizza) 
  

Posted
Where client file ?

I use triggerServerEvent("destroyPizza", localPlayer)

for addPizza i use triggerServerEvent("addPizza", localPlayer) it work's

Posted

Read through your code. You're trying to use destroyElement with a function. pizzaHand is your function, not the object.

Besides, your pizza object is local to the function pizzaHand. The function destroyPizza would not be able to find it.

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