roddydennvor Posted March 22, 2015 Share Posted March 22, 2015 I just edit this script from command to event handler , But how to add this to item system , so when i use helmet (item id 90) then this event running ... Thx B4 addEvent( "helmet", true ) local cases = {} for i,v in ipairs(getElementsByType("player"))do setElementData(v, "helmet", 0) end function helmet( source ) if (getResourceState(getResourceFromName("bone_attach")) == "running") then if (getElementData(source, "helmet") ~=1) then setElementData(source, "helmet", 1) case = createObject(1210,0,0,0) exports.bone_attach:attachElementToBone(case,source,12,0,0.05,0.27,0,180,0) cases[source] = case outputChatBox("Helmet:- True.", source, 0, 255, 0) else setElementData(source, "helmet", 0) exports.bone_attach:detachElementFromBone(cases[source]) destroyElement(cases[source]) outputChatBox("Helmet:- False.", source, 255, 50, 0) end else outputChatBox("ERROR #2 Resource not found.", source, 255, 50, 0) end end addEventHandler( "helmet", root, helmet ) Link to comment
roddydennvor Posted March 27, 2015 Author Share Posted March 27, 2015 Can someone help me ?? Link to comment
Mann56 Posted March 27, 2015 Share Posted March 27, 2015 Can someone help me ?? Debugscript? Provide what is mentioned in debugscript --> /debugscript 3 Link to comment
TrapLord Studios™ Posted March 27, 2015 Share Posted March 27, 2015 In your item script, just addin a line so it will execute the command handler "helmet". Link to comment
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