Clydian Posted June 4, 2015 Share Posted June 4, 2015 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) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now