DarkMagic Posted July 20, 2018 Posted July 20, 2018 (edited) Hi guys! I want to make a script like : when i use the item then the script attcahes a kevlar vest to my character , but it's not working the code : elementVest = {} function createVest () x,y,z = getElementPosition(source) elementVest[source] = createObject(1242,x,y,z) exports.bone_attach:attachElementToBone(elementVest[source],source,3,0,0,0,3,-5,0) setElementCollisionsEnabled(elementVest[source], false) setObjectScale(elementVest[source], 1.2) end addEvent("createVest", true) addEventHandler("createVest", getRootElement(), createVest) debugscript says:[ERROR][string"?"]attempt to call global 'type' (a number value) Edited July 20, 2018 by DarkMagic ..
DarkMagic Posted July 20, 2018 Author Posted July 20, 2018 debugscript says:[ERROR][string"?"]:34:attempt to call global 'type' (a number value)
Addlibs Posted July 20, 2018 Posted July 20, 2018 It doesn't seem like you've posted the part with line 34, or if you did, please tell us which of the snippet is line 34.
DarkMagic Posted July 20, 2018 Author Posted July 20, 2018 The full script has 945 line … there is no problem with the 34th line . but if i use this "function" debug says that . If u use attachElement instead of attachElementToBone then it works But the attachElement is not that good , cause when i crouch then the object stays in the air, but if i run the object "follows" me but not attaches to my character!
Discord Moderators Pirulax Posted July 20, 2018 Discord Moderators Posted July 20, 2018 You have overwritten the function called 'type'. And since exports table uses that its :Oed. Submitted a PR right now. Just rename the variable in you script from 'type' to something else.
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