RandomRambo Posted August 30, 2021 Share Posted August 30, 2021 Hello guys. I just tryed to do more weapons on DayZ mode. I downloaded some random DayZ mode and found system for weapons on 1 id. Tryed to move this function in my mode and I did it. Everything is good,but if I take this gun (which I added on 1 id with another model) I get 2 models in my hand (1 basic and 1 mine) (btw it's secondary melee weapon). How I can hide basic model of gun If I take weapon which I added on this same ID?Help,please. There is the function: elementWeaponRaplace = {} elementWeaponRaplace2 = {} raplaceSettings = { ["Hatchet Of God"] = { twohand = false, model = 2326 }, } function weaponReplace ( previousWeaponID, currentWeaponID ) local weapon1 = getElementData(source,"currentweapon_1") local weapon2 = getElementData(source,"currentweapon_2") if not weapon1 and not weapon2 then return end local ammoData1,weapID1 = getWeaponAmmoType(weapon1) local ammoData2,weapID2 = getWeaponAmmoType(weapon2) local x,y,z = getElementPosition(source) local rx,ry,rz = getElementRotation(source) local curweap if currentWeaponID == weapID1 then curweap = weapon1 elseif currentWeaponID == weapID2 then curweap = weapon2 end if isElement(elementWeaponRaplace[source]) then detachElementFromBone(elementWeaponRaplace[source]) destroyElement(elementWeaponRaplace[source]) elementWeaponRaplace[source] = false end if isElement(elementWeaponRaplace2[source]) then detachElementFromBone(elementWeaponRaplace2[source]) destroyElement(elementWeaponRaplace2[source]) elementWeaponRaplace2[source] = false end if curweap and raplaceSettings[curweap] then elementWeaponRaplace[source] = createObject(raplaceSettings[curweap].model,x,y,z) setElementData(source,"weaponSwithModel",elementWeaponRaplace[source]) attachElementToBone(elementWeaponRaplace[source],source,12,0,0,0,180,90,180) if raplaceSettings[curweap].twohand then elementWeaponRaplace2[source] = createObject(raplaceSettings[curweap].model,x,y,z) attachElementToBone(elementWeaponRaplace2[source],source,11,0,0.05,0,180,100,0) end end end addEventHandler ( "onPlayerWeaponSwitch", getRootElement(), weaponReplace ) weaponModels = { ---- ["Hatchet Of God"] = { coords = {14,0.11,0,0,180,90,270}, coords2 = {14,0.11,0,0,180,90,270}, id = 4, model = 2326}, ---- } Link to comment
XaskeL Posted August 31, 2021 Share Posted August 31, 2021 You can replace the standard model with a transparent mesh or apply a shader to the standard model Link to comment
RandomRambo Posted August 31, 2021 Author Share Posted August 31, 2021 On 31/08/2021 at 01:35, XaskeL said: You can replace the standard model with a transparent mesh or apply a shader to the standard model Expand Can u give me an example,please? Link to comment
XaskeL Posted August 31, 2021 Share Posted August 31, 2021 On 31/08/2021 at 03:01, RandomRambo said: Can u give me an example,please? Expand Dropbox: https://www.dropbox.com/s/bgs8dt7z62ctmct/test_empty.zip?dl=0 Link to comment
RandomRambo Posted August 31, 2021 Author Share Posted August 31, 2021 On 31/08/2021 at 04:41, XaskeL said: Dropbox: https://www.dropbox.com/s/bgs8dt7z62ctmct/test_empty.zip?dl=0 Expand Thanks but I need everyone can see changed model (not only me) On 31/08/2021 at 04:41, XaskeL said: Dropbox: https://www.dropbox.com/s/bgs8dt7z62ctmct/test_empty.zip?dl=0 Expand I checked ur script,u just hide models with empty dff but if I do this, original model of melee weapon (I have gun on original model) will hide too,am I right? Link to comment
XaskeL Posted August 31, 2021 Share Posted August 31, 2021 On 31/08/2021 at 16:43, RandomRambo said: Thanks but I need everyone can see changed model (not only me) I checked ur script,u just hide models with empty dff but if I do this, original model of melee weapon (I have gun on original model) will hide too,am I right? Expand You need to remove the required object identifiers from the table. Link to comment
RandomRambo Posted August 31, 2021 Author Share Posted August 31, 2021 On 31/08/2021 at 17:01, XaskeL said: You need to remove the required object identifiers from the table. Expand Okay,but what with " I need everyone can see changed model (not only me)"? Link to comment
XaskeL Posted September 1, 2021 Share Posted September 1, 2021 On 31/08/2021 at 17:14, RandomRambo said: Okay,but what with " I need everyone can see changed model (not only me)"? Expand Use "pattach" or "bone_attach" ( by CrystalMV ) and attach new weapon model to hand Link to comment
RandomRambo Posted September 1, 2021 Author Share Posted September 1, 2021 Still searching better solution for this function.. If u can help,help please. Link to comment
RandomRambo Posted September 4, 2021 Author Share Posted September 4, 2021 Close this thread,found solution. Link to comment
Administrators Tut Posted September 4, 2021 Administrators Share Posted September 4, 2021 Closing this as requested Link to comment
Recommended Posts