Jump to content

[HELP] Need coordinates for backpacks


Clydian

Recommended Posts

So i need that backpac stays on the players back, like it should be. But the backpack is wayy off in the distance.

function backPackBack(dataName, oldValue) 
  if getElementType(source) == "player" and dataName == "MAX_Slots" then 
    local newValue = getElementData(source, dataName) 
    if elementBackpack[source] then 
      detachElementFromBone(elementBackpack[source]) 
      destroyElement(elementBackpack[source]) 
      elementBackpack[source] = false 
    end 
    local x, y, z = getElementPosition(source) 
    local rx, ry, rz = getElementRotation(source) 
    if newValue == 10 then 
      elementBackpack[source] = createObject(3026, x, y, z) 
    elseif newValue == 20 then 
      elementBackpack[source] = createObject(1248, x, y, z) 
    elseif newValue == 34 then 
      elementBackpack[source] = createObject(1252, x, y, z) 
    elseif newValue == 46 then 
      return 
    end 
    attachElementToBone(elementBackpack[source], source, 3, 0.19, -0.11, -0.1, 0, 270, 10) 
  end 
end 
addEventHandler("onElementDataChange", getRootElement(), backPackBack) 

RCWvHWZ.png

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