Jump to content

small question


Recommended Posts

i tried to make something and got this but i just dont know what to put in the

createObject (object[source],"here what i put?") 

   addEventHandler ( "onPlayerQuit", root, 
function (quiteType)--onPlayerQuit 
    local playeraccount = getPlayerAccount(source) 
    if not isGuestAccount ( playeraccount) then 
     hat = getElementModel object[source]) 
        setAccountData(playeraccount,"number",hat ) 
    end 
end) 
  
  
-- # Server Side 
addEventHandler ( "onPlayerLogin", root, 
function ( _,account ) 
    local number = getAccountData(account,"number") 
    if  playermoney  then 
    createObject (object[source], ) 
        exports.bone_attach:attachElementToBone(object[source],source,1,0,0,0.1,0,0,0) 
    end 
end 
) 

Link to comment

I mean something like this :

-- # Server Side 
addEventHandler ( "onPlayerLogin", root, 
function ( _,account ) 
    local ObjectID = getAccountData ( account,"Object" ) 
    if ( object[source] and isElement ( object[source] ) ) then 
    destroyElement ( object[source] ) 
    object[source] = nil end 
    local x,y,z = getElementPosition ( source ) 
    object[ source ] = createObject ( ObjectID , x,y,z ) 
    if ( object[source] and isElement ( object[source] ) ) then 
        exports.bone_attach:attachElementToBone(object[source],source,1,0,0,0.1,0,0,0) 
    end 
end 
) 
Link to comment

someting like this ?

    addEventHandler ( "onPlayerQuit", root, 
function (quiteType)--onPlayerQuit 
    local playeraccount = getPlayerAccount(source) 
    if not isGuestAccount ( playeraccount) then 
        setAccountData(playeraccount,"Object",exports.bone_attach:getElementBoneAttachmentDetails(object[source]) ) 
    end 
end) 
  
  
-- # Server Side 
addEventHandler ( "onPlayerLogin", root, 
function ( _,account ) 
    local ObjectID = getAccountData ( account,"Object" ) 
    if ( object[source] and isElement ( object[source] ) ) then 
    destroyElement ( object[source] ) 
    object[source] = nil end 
    local x,y,z = getElementPosition ( source ) 
    object[ source ] = createObject ( ObjectID , x,y,z ) 
    if ( object[source] and isElement ( object[source] ) ) then 
        exports.bone_attach:attachElementToBone(object[source],source,1,0,0,0.1,0,0,0) 
    end 
end 
) 

Link to comment

-- # Server Side 
object = { } 
addEvent("CreateTheObject",true) 
addEventHandler("CreateTheObject",getRootElement(), 
    function ( Model ) 
        if ( object[source] and isElement ( object[source] ) ) then 
            destroyElement (    object[source]    ) 
        end 
        local x,y,z = getElementPosition ( source ) 
        object[source] = createObject ( Model , x , y , z ) 
        setAccountData ( getPlayerAccount ( source ) , "Model" , getElementModel ( object[source] ) ) 
        exports.bone_attach:attachElementToBone(object[source],source,1,0,0,0.1,0,0,0) 
        if getElementModel ( object[source] ) == 3515 then 
        setObjectScale ( object[source] , 0.2 ) 
    end 
    if getElementModel ( object[source] ) == 1248 then 
    setObjectScale ( object[source] , 1.3 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1,0,0.03,0.1,0,0,180) 
    end 
    if getElementModel ( object[source] ) == 2045 then 
    setObjectScale ( object[source] , 1 ) 
    exports.bone_attach:attachElementToBone(object[source],source,12,-0.2,0,0.08,0,0,90) 
    end 
    if getElementModel ( object[source] ) == 13562 then 
    setObjectScale ( object[source] , 0.2 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1,0,0.03,0.2,0,0,0) 
    end 
    if getElementModel ( object[source] ) == 1512 then 
    setObjectScale ( object[source] , 0.1 ) 
    setElementAlpha ( object[source] , 0 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1,0,0.03,0.1,0,0,180) 
    end 
    if getElementModel ( object[source] ) == 3524 then 
    setObjectScale ( object[source] , 0.4 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1,0,0.036,-0.8,0,0,180) 
    end 
    if getElementModel ( object[source] ) == 2908 then 
    setObjectScale ( object[source] , 1.4 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1,0,0.1,0.1,270,90,0) 
    end 
    if getElementModel ( object[source] ) == 1485 then 
    setObjectScale ( object[source] , 1.4 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, -0.01, -0.01, -0.035, 0, 90, 0 ) 
    end 
    if getElementModel ( object[source] ) == 330 then 
    setObjectScale ( object[source] , 1 ) 
    exports.bone_attach:attachElementToBone(object[source],source,12, 0, 0, 0.01, 0, -50, 0 ) 
    end 
    if getElementModel ( object[source] ) == 3027 then 
    setObjectScale ( object[source] , 1.3 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, -0.01, 0.09, 0, 90, 90, 90 ) 
    smoke = createObject ( 1485 , x , y , z ) 
    exports.bone_attach:attachElementToBone(smoke,source,1, -0.02, 0.06, 0.03, 90, 90, 0 ) 
    setElementAlpha ( smoke , 0 )  
    end 
    if getElementModel ( object[source] ) == 1485 then 
    setObjectScale ( object[source] , 1.4 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, -0.01, -0.01, -0.035, 90, 0, 0 ) 
    end 
    if getElementModel ( object[source] ) == 1736 then 
    setElementDoubleSided ( object[source], true ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, 0, 0, 0, 0, 0, 180 ) 
    end 
    if getElementModel ( object[source] ) == 2589 then 
    setElementDoubleSided ( object[source], true ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, 0, 0, -0.9, 0, 180, 180 ) 
    end 
    if getElementModel ( object[source] ) == 1786 then 
    setElementDoubleSided ( object[source], true ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, 0, -0.15, -0.2, 0, 0, 180 ) 
    end 
    if getElementModel ( object[source] ) == 16779 then 
    setElementDoubleSided ( object[source], true ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, 0, 0, -0.1, 0, 180, 180 ) 
    end 
    if getElementModel ( object[source] ) == 3528 then 
    setObjectScale ( object[source] , 0.09 ) 
    setElementDoubleSided ( object[source], true ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, 0.018, 0.1, 0.1, 0, 0, 90 ) 
    end 
    if getElementModel ( object[source] ) == 7093 then 
    setObjectScale ( object[source] , 0.2 ) 
    setElementDoubleSided ( object[source], true ) 
    setElementCollisionsEnabled ( object[source], true ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, 0, 0.6, 0.2, 0, 0, 0 ) 
    end 
end 
) 
  
addEventHandler ( "onPlayerLogin", root, 
function ( _,account ) 
    local ObjectID = getAccountData ( account,"Model" ) 
    if ( object[source] and isElement ( object[source] ) ) then 
    destroyElement ( object[source] ) 
    object[source] = nil end 
    local x,y,z = getElementPosition ( source ) 
    object[ source ] = createObject ( ObjectID , x,y,z ) 
    if ( object[source] and isElement ( object[source] ) ) then 
        exports.bone_attach:attachElementToBone(object[source],source,1,0,0,0.1,0,0,0) 
    end 
end 
) 
Link to comment

i triyed to make this but doesnt work

at line 89

-- # Server Side 
object = { } 
addEvent("CreateTheObject",true) 
addEventHandler("CreateTheObject",getRootElement(), 
    function ( Model ) 
        if ( object[source] and isElement ( object[source] ) ) then 
            destroyElement (    object[source]    ) 
        end 
        local x,y,z = getElementPosition ( source ) 
        object[source] = createObject ( Model , x , y , z ) 
        setAccountData ( getPlayerAccount ( source ) , "Model" , getElementModel ( object[source] ) ) 
        exports.bone_attach:attachElementToBone(object[source],source,1,0,0,0.1,0,0,0) 
        if getElementModel ( object[source] ) == 3515 then 
        setObjectScale ( object[source] , 0.2 ) 
    end 
    if getElementModel ( object[source] ) == 1248 then 
    setObjectScale ( object[source] , 1.3 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1,0,0.03,0.1,0,0,180) 
    end 
    if getElementModel ( object[source] ) == 2045 then 
    setObjectScale ( object[source] , 1 ) 
    exports.bone_attach:attachElementToBone(object[source],source,12,-0.2,0,0.08,0,0,90) 
    end 
    if getElementModel ( object[source] ) == 13562 then 
    setObjectScale ( object[source] , 0.2 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1,0,0.03,0.2,0,0,0) 
    end 
    if getElementModel ( object[source] ) == 1512 then 
    setObjectScale ( object[source] , 0.1 ) 
    setElementAlpha ( object[source] , 0 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1,0,0.03,0.1,0,0,180) 
    end 
    if getElementModel ( object[source] ) == 3524 then 
    setObjectScale ( object[source] , 0.4 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1,0,0.036,-0.8,0,0,180) 
    end 
    if getElementModel ( object[source] ) == 2908 then 
    setObjectScale ( object[source] , 1.4 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1,0,0.1,0.1,270,90,0) 
    end 
    if getElementModel ( object[source] ) == 1485 then 
    setObjectScale ( object[source] , 1.4 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, -0.01, -0.01, -0.035, 0, 90, 0 ) 
    end 
    if getElementModel ( object[source] ) == 330 then 
    setObjectScale ( object[source] , 1 ) 
    exports.bone_attach:attachElementToBone(object[source],source,12, 0, 0, 0.01, 0, -50, 0 ) 
    end 
    if getElementModel ( object[source] ) == 3027 then 
    setObjectScale ( object[source] , 1.3 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, -0.01, 0.09, 0, 90, 90, 90 ) 
    smoke = createObject ( 1485 , x , y , z ) 
    exports.bone_attach:attachElementToBone(smoke,source,1, -0.02, 0.06, 0.03, 90, 90, 0 ) 
    setElementAlpha ( smoke , 0 ) 
    end 
    if getElementModel ( object[source] ) == 1485 then 
    setObjectScale ( object[source] , 1.4 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, -0.01, -0.01, -0.035, 90, 0, 0 ) 
    end 
    if getElementModel ( object[source] ) == 1736 then 
    setElementDoubleSided ( object[source], true ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, 0, 0, 0, 0, 0, 180 ) 
    end 
    if getElementModel ( object[source] ) == 2589 then 
    setElementDoubleSided ( object[source], true ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, 0, 0, -0.9, 0, 180, 180 ) 
    end 
    if getElementModel ( object[source] ) == 1786 then 
    setElementDoubleSided ( object[source], true ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, 0, -0.15, -0.2, 0, 0, 180 ) 
    end 
    if getElementModel ( object[source] ) == 16779 then 
    setElementDoubleSided ( object[source], true ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, 0, 0, -0.1, 0, 180, 180 ) 
    end 
    if getElementModel ( object[source] ) == 3528 then 
    setObjectScale ( object[source] , 0.09 ) 
    setElementDoubleSided ( object[source], true ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, 0.018, 0.1, 0.1, 0, 0, 90 ) 
    end 
    if getElementModel ( object[source] ) == 7093 then 
    setObjectScale ( object[source] , 0.2 ) 
    setElementDoubleSided ( object[source], true ) 
    setElementCollisionsEnabled ( object[source], true ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, 0, 0.6, 0.2, 0, 0, 0 ) 
    end 
end 
) 
addEventHandler ( "onPlayerQuit", root, 
function ( bla, ) 
    if ( object[source] and isElement ( object[source] ) ) then 
    destroyElement ( object[source] ) 
  
  
  
addEventHandler ( "onPlayerLogin", root, 
function ( _,account ) 
    local ObjectID = getAccountData ( account,"Model" ) 
    if ( object[source] and isElement ( object[source] ) ) then 
    destroyElement ( object[source] ) 
    object[source] = nil end 
    local x,y,z = getElementPosition ( source ) 
    object[ source ] = createObject ( ObjectID , x,y,z ) 
    if ( object[source] and isElement ( object[source] ) ) then 
        exports.bone_attach:attachElementToBone(object[source],source,1,0,0,0.1,0,0,0) 
    end 
    if getElementModel ( object[source] ) == 2045 then 
    setObjectScale ( object[source] , 1 ) 
    exports.bone_attach:attachElementToBone(object[source],source,12,-0.2,0,0.08,0,0,90) 
    end 
end 
) 

Link to comment

-- # Server Side 
object = { } 
addEvent("CreateTheObject",true) 
addEventHandler("CreateTheObject",getRootElement(), 
    function ( Model ) 
        if ( object[source] and isElement ( object[source] ) ) then 
            destroyElement (    object[source]    ) 
        end 
        local x,y,z = getElementPosition ( source ) 
        object[source] = createObject ( Model , x , y , z ) 
        setAccountData ( getPlayerAccount ( source ) , "Model" , getElementModel ( object[source] ) ) 
        exports.bone_attach:attachElementToBone(object[source],source,1,0,0,0.1,0,0,0) 
        if getElementModel ( object[source] ) == 3515 then 
        setObjectScale ( object[source] , 0.2 ) 
    end 
    if getElementModel ( object[source] ) == 1248 then 
    setObjectScale ( object[source] , 1.3 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1,0,0.03,0.1,0,0,180) 
    end 
    if getElementModel ( object[source] ) == 2045 then 
    setObjectScale ( object[source] , 1 ) 
    exports.bone_attach:attachElementToBone(object[source],source,12,-0.2,0,0.08,0,0,90) 
    end 
    if getElementModel ( object[source] ) == 13562 then 
    setObjectScale ( object[source] , 0.2 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1,0,0.03,0.2,0,0,0) 
    end 
    if getElementModel ( object[source] ) == 1512 then 
    setObjectScale ( object[source] , 0.1 ) 
    setElementAlpha ( object[source] , 0 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1,0,0.03,0.1,0,0,180) 
    end 
    if getElementModel ( object[source] ) == 3524 then 
    setObjectScale ( object[source] , 0.4 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1,0,0.036,-0.8,0,0,180) 
    end 
    if getElementModel ( object[source] ) == 2908 then 
    setObjectScale ( object[source] , 1.4 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1,0,0.1,0.1,270,90,0) 
    end 
    if getElementModel ( object[source] ) == 1485 then 
    setObjectScale ( object[source] , 1.4 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, -0.01, -0.01, -0.035, 0, 90, 0 ) 
    end 
    if getElementModel ( object[source] ) == 330 then 
    setObjectScale ( object[source] , 1 ) 
    exports.bone_attach:attachElementToBone(object[source],source,12, 0, 0, 0.01, 0, -50, 0 ) 
    end 
    if getElementModel ( object[source] ) == 3027 then 
    setObjectScale ( object[source] , 1.3 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, -0.01, 0.09, 0, 90, 90, 90 ) 
    smoke = createObject ( 1485 , x , y , z ) 
    exports.bone_attach:attachElementToBone(smoke,source,1, -0.02, 0.06, 0.03, 90, 90, 0 ) 
    setElementAlpha ( smoke , 0 ) 
    end 
    if getElementModel ( object[source] ) == 1485 then 
    setObjectScale ( object[source] , 1.4 ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, -0.01, -0.01, -0.035, 90, 0, 0 ) 
    end 
    if getElementModel ( object[source] ) == 1736 then 
    setElementDoubleSided ( object[source], true ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, 0, 0, 0, 0, 0, 180 ) 
    end 
    if getElementModel ( object[source] ) == 2589 then 
    setElementDoubleSided ( object[source], true ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, 0, 0, -0.9, 0, 180, 180 ) 
    end 
    if getElementModel ( object[source] ) == 1786 then 
    setElementDoubleSided ( object[source], true ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, 0, -0.15, -0.2, 0, 0, 180 ) 
    end 
    if getElementModel ( object[source] ) == 16779 then 
    setElementDoubleSided ( object[source], true ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, 0, 0, -0.1, 0, 180, 180 ) 
    end 
    if getElementModel ( object[source] ) == 3528 then 
    setObjectScale ( object[source] , 0.09 ) 
    setElementDoubleSided ( object[source], true ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, 0.018, 0.1, 0.1, 0, 0, 90 ) 
    end 
    if getElementModel ( object[source] ) == 7093 then 
    setObjectScale ( object[source] , 0.2 ) 
    setElementDoubleSided ( object[source], true ) 
    setElementCollisionsEnabled ( object[source], true ) 
    exports.bone_attach:attachElementToBone(object[source],source,1, 0, 0.6, 0.2, 0, 0, 0 ) 
    end 
end 
) 
  
addEventHandler("onPlayerQuit",getRootElement(), 
    function (  ) 
        if ( object[source] and isElement ( object[source] ) ) then 
        destroyElement ( object[source] )        
        object[source] = nil  
    end 
end 
) 
  
  
  
addEventHandler ( "onPlayerLogin", root, 
function ( _,account ) 
    local ObjectID = getAccountData ( account,"Model" ) 
    if ( object[source] and isElement ( object[source] ) ) then 
    destroyElement ( object[source] ) 
    object[source] = nil end 
    local x,y,z = getElementPosition ( source ) 
    object[ source ] = createObject ( ObjectID , x,y,z ) 
    if ( object[source] and isElement ( object[source] ) ) then 
        exports.bone_attach:attachElementToBone(object[source],source,1,0,0,0.1,0,0,0) 
    end 
    if getElementModel ( object[source] ) == 2045 then 
    setObjectScale ( object[source] , 1 ) 
    exports.bone_attach:attachElementToBone(object[source],source,12,-0.2,0,0.08,0,0,90) 
    end 
end 
) 
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...