DzMG-LV Posted August 9, 2015 Posted August 9, 2015 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)
DzMG-LV Posted August 9, 2015 Author Posted August 9, 2015 Where client file ? I use triggerServerEvent("destroyPizza", localPlayer) for addPizza i use triggerServerEvent("addPizza", localPlayer) it work's
Dealman Posted August 9, 2015 Posted August 9, 2015 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now