Jump to content

Need help with script.


iJustD

Recommended Posts

WARNING: [gamemode]/weapon/backpack/server.lua:43: Bad argument @ 'setPedAnimation' [Expected number at argument 8, got boolean] < Console Log.

Script is : 

addEvent("backpackGroundOpen",true)
addEventHandler("backpackGroundOpen",getRootElement(),function()
    if isPedInVehicle(source) then return end
    if isElementInWater(source) then return end
    --setPedAnimation (source,"BOMBER","BOM_Plant_Loop",nil,false,false,false,false)
    setPedAnimation(source,"BOMBER","BOM_Plant_Loop",nil,true,false,false,false)
    local x,y,z = getElementPosition(source)
    prot = getPedRotation(source)
    local offsetRot = math.rad(prot+90)
    local vx = x + 0.75 * math.cos(offsetRot)
    local vy = y + 0.75 * math.sin(offsetRot)
    local vrot = prot+180
    local backpackSlots = getElementData(source,"MAX_Slots")
    if (backpackSlots == 12 or backpackSlots == 16) then
        backpackGround[source] = createObject(1866,vx,vy,z-0.8,100,180,vrot)
    elseif (backpackSlots == 13 or backpackSlots == 17) then
        backpackGround[source] = createObject(1867,vx,vy,z-0.8,100,180,vrot)
    elseif (backpackSlots == 20 or backpackSlots == 24) then
        backpackGround[source] = createObject(1868,vx,vy,z-0.8,100,180,vrot)
    elseif (backpackSlots == 25 or backpackSlots == 29) then
        backpackGround[source] = createObject(1869,vx,vy,z-0.9,100,180,vrot)
    elseif (backpackSlots == 30 or backpackSlots == 34) then
        backpackGround[source] = createObject(1870,vx,vy,z-0.8,100,180,vrot)
    elseif (backpackSlots == 35 or backpackSlots == 39) then
        backpackGround[source] = createObject(1871,vx,vy,z-0.75,-70,0,vrot)
    end
    if elementBackpack[source] and isElement(elementBackpack[source]) then
        setElementAlpha(elementBackpack[source],0)
    end
end)

Link to comment
addEvent("backpackGroundOpen",true)
addEventHandler("backpackGroundOpen",getRootElement(),function()
    if isPedInVehicle(source) then return end
    if isElementInWater(source) then return end
    setPedAnimation(source,"BOMBER","BOM_Plant_Loop",1000,true,false,false,false)
    local x,y,z = getElementPosition(source)
    prot = getPedRotation(source)
    local offsetRot = math.rad(prot+90)
    local vx = x + 0.75 * math.cos(offsetRot)
    local vy = y + 0.75 * math.sin(offsetRot)
    local vrot = prot+180
    local backpackSlots = getElementData(source,"MAX_Slots")
    if (backpackSlots == 12 or backpackSlots == 16) then
        backpackGround[source] = createObject(1866,vx,vy,z-0.8,100,180,vrot)
    elseif (backpackSlots == 13 or backpackSlots == 17) then
        backpackGround[source] = createObject(1867,vx,vy,z-0.8,100,180,vrot)
    elseif (backpackSlots == 20 or backpackSlots == 24) then
        backpackGround[source] = createObject(1868,vx,vy,z-0.8,100,180,vrot)
    elseif (backpackSlots == 25 or backpackSlots == 29) then
        backpackGround[source] = createObject(1869,vx,vy,z-0.9,100,180,vrot)
    elseif (backpackSlots == 30 or backpackSlots == 34) then
        backpackGround[source] = createObject(1870,vx,vy,z-0.8,100,180,vrot)
    elseif (backpackSlots == 35 or backpackSlots == 39) then
        backpackGround[source] = createObject(1871,vx,vy,z-0.75,-70,0,vrot)
    end
    if elementBackpack[source] and isElement(elementBackpack[source]) then
        setElementAlpha(elementBackpack[source],0)
    end
end)

Try This

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