Hulkan Posted September 14, 2017 Share Posted September 14, 2017 Hi, im stuck with backpack pos problem trying to fix but doesnt work for me Thats Czech vest pouch that i have a problem. I know how to fix with bigger slot backpacks but with small one doesnt work http://prntscr.com/gl1xxh addEventHandler("onElementDataChange", root, function(dataName, oldValue) if not oldValue then oldValue = 0; end if (getElementType(source) == "player") then if (dataName == "MAX_Slots") then local newValue = getElementData(source, dataName); removeBackpack(source); local x,y,z = getElementPosition(source); if (newValue == 12) then elementBackpack[source] = createObject(373, x, y, z); -- Czech Vest Pouch elseif (newValue == 16) then elementBackpack[source] = createObject(3026, x, y, z); -- Assault Pack (ACU) elseif (newValue == 22) then elementBackpack[source] = createObject(1248, x, y, z); -- Alice Pack elseif (newValue == 26) then elementBackpack[source] = createObject(1575, x, y, z); -- Czech Backpack elseif (newValue >= 36) then elementBackpack[source] = createObject(1252, x, y, z); -- Coyote Backpack elseif (newValue == 8) then return; end if elementBackpack[source] then setElementData(source, "tohide2", elementBackpack[source]); if (newValue >= 36) then setObjectScale(elementBackpack[source], 0.95); end end if (newValue == 26) then attachElementToBone(elementBackpack[source], source, 3, 0, -0.16, 0.05, 270, 0, 180); else attachElementToBone(elementBackpack[source], source, 3, 0, -0.225, 0.05, 90, 0, 0); end Link to comment
Hulkan Posted September 14, 2017 Author Share Posted September 14, 2017 Can someone help ? Link to comment
Tekken Posted September 14, 2017 Share Posted September 14, 2017 It's because the backpack model you added have a different rotation. You will have to play around with the last 3 digits of the attachElementToBone function (line 23). Try this one: attachElementToBone(elementBackpack[source], source, 3, 0, -0.225, 0.05, 90, 0, 90); or this one attachElementToBone(elementBackpack[source], source, 3, 0, -0.225, 0.05, 90, 0, -90); Not sure though. 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