Shady1 Posted May 6, 2023 Posted May 6, 2023 3 hours ago, kukimuki said: how to make that to the weapon shows in my back? -- Define the weapon model and its attachment bone local weaponModel = 355 -- Change this to the model ID of the weapon you want to show local boneName = "spine" -- Get the player element and its position local player = getLocalPlayer() local x, y, z = getElementPosition(player) -- Create the weapon object and attach it to the player's bone local weaponObject = createObject(weaponModel, x, y, z) attachElements(weaponObject, player, 0.3, -0.3, 0.6, 0, 0, 180, boneName) use boneAttach
Shady1 Posted May 6, 2023 Posted May 6, 2023 41 minutes ago, kukimuki said: can u help me? Its not working this was just a sample code, you can do it using bone attach.
FLUSHBICEPS Posted May 6, 2023 Posted May 6, 2023 make sure pAttach resource is installed, use /attachweapon <weaponID>, also make adjustments on attach function function attachWeaponToBack(player, weaponModel) local weaponObject = createObject(weaponModel, 0, 0, 0) exports.pAttach:attach(weaponObject, player, "Bip01 Spine", 0, -0.1, 0.2, 0, 180, 0) end addCommandHandler("attachweapon", function(player, command, weaponID) local weaponModel = tonumber(weaponID) if weaponModel then attachWeaponToBack(player, weaponModel) outputChatBox("Weapon attached to your back.", player) else outputChatBox("Invalid weapon ID.", player) end end )
kukimuki Posted May 9, 2023 Author Posted May 9, 2023 On 06/05/2023 at 23:16, FLUSHBICEPS said: make sure pAttach resource is installed, use /attachweapon <weaponID>, also make adjustments on attach function function attachWeaponToBack(player, weaponModel) local weaponObject = createObject(weaponModel, 0, 0, 0) exports.pAttach:attach(weaponObject, player, "Bip01 Spine", 0, -0.1, 0.2, 0, 180, 0) end addCommandHandler("attachweapon", function(player, command, weaponID) local weaponModel = tonumber(weaponID) if weaponModel then attachWeaponToBack(player, weaponModel) outputChatBox("Weapon attached to your back.", player) else outputChatBox("Invalid weapon ID.", player) end end ) How i can download the pAttach? Cuz I tried one and it didnt worked
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