Jump to content

>> Help me Change This <<


roddydennvor

Recommended Posts

Hallo #88,,,

In the following script, I have to type the command "/bcase" to bring up the case ...

local cases = {} 
  
for i,v in ipairs(getElementsByType("player"))do 
setElementData(v, "bcase", 0) 
end 
  
addCommandHandler("bcase", 
    function(player) 
        if(getResourceState(getResourceFromName("bone_attach")) == "running")then 
            if(getElementType(player) == "player")then 
                if(getElementData(player, "bcase") ~= 1)then 
                    setElementData(player, "bcase", 1) 
                    case = createObject(1210,0,0,0) 
                    exports.bone_attach:attachElementToBone(case,player,12,0,0.05,0.27,0,180,0) 
                    cases[player] = case 
                elseif(getElementData(player, "bcase") == 1)then 
                    setElementData(player, "bcase", 0) 
                    exports.bone_attach:detachElementFromBone(cases[player]) 
                    destroyElement(cases[player]) 
                end 
            end 
        else 
            outputChatBox("ERROR #1", player, 255, 50, 0) 
        end 
    end 
) 

Well , how can I make this case arises when I have an item case in my inventory ?

Thank you for your assistance, your help is precious :)

Author : ~Bcase Script : simmon95

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