Actimel Posted March 17, 2017 Share Posted March 17, 2017 Hi again i managed add 3 backpacks and they work everything good then i added more 3 backpacks but now they work also good but the problem is that they are flipped like this : @NeXuS™ maybe you can help me again? Link to comment
NeXuS™ Posted March 17, 2017 Share Posted March 17, 2017 Use setElementRotation on them. Can you copy the code again? And give me a list of those backpacks which are flipped. Link to comment
Actimel Posted March 17, 2017 Author Share Posted March 17, 2017 (edited) 1 minute ago, NeXuS™ said: Use setElementRotation on them. Can you copy the code again? And give me a list of those backpacks which are flipped. 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(3026, x, y, z); -- Assault Pack (ACU) elseif (newValue == 16) 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 == 44) then elementBackpack[source] = createObject(2734, x, y, z); -- Hunting Backpack elseif (newValue == 58) then elementBackpack[source] = createObject(371, x, y, z); -- violet Backpack WORKS GOOD elseif (newValue == 63) then elementBackpack[source] = createObject(373, x, y, z); -- orange Backpack WORKS GOOD elseif (newValue == 66) then elementBackpack[source] = createObject(2704, x, y, z); -- green Backpack WORKS GOOD elseif (newValue == 75) then elementBackpack[source] = createObject(2052, x, y, z); -- red mou Backpack Rotation problem elseif (newValue == 80) then elementBackpack[source] = createObject(2053, x, y, z); -- orange mou Backpack Rotation problem elseif (newValue >= 86) then elementBackpack[source] = createObject(2054, x, y, z); -- green mou Backpack Rotation problem elseif (newValue == 8) then return; end if elementBackpack[source] then setElementData(source, "tohide2", elementBackpack[source]); if (newValue >= 86) then setObjectScale(elementBackpack[source], 1.1); 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 @NeXuS™ this one ? Edited March 17, 2017 by Actimel Link to comment
NeXuS™ Posted March 17, 2017 Share Posted March 17, 2017 That one. And which backpacks are flipped? 1 Link to comment
Actimel Posted March 17, 2017 Author Share Posted March 17, 2017 Just now, NeXuS™ said: That one. And which backpacks are flipped? these 3 last ones mou backpacks Link to comment
NeXuS™ Posted March 17, 2017 Share Posted March 17, 2017 if (newValue == 26 or newValue == 75 or newValue == 80 or newValue == 86) 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 Replace line nr. 26 to nr 29. with this. Link to comment
Actimel Posted March 17, 2017 Author Share Posted March 17, 2017 1 minute ago, NeXuS™ said: if (newValue == 26 or newValue == 75 or newValue == 80 or newValue == 86) 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 Replace line nr. 26 to nr 29. with this. thanks man a lot it worked 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