Jump to content

HELP NOT WORK


Recommended Posts

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

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