KalashnikovZ Posted January 3, 2016 Share Posted January 3, 2016 Hi. Just asked for some help in other topics, tried many different ways, but my script is still not working. I don't know what did i mess up, but it's still not working. (Btw, i was heading to make a custom weapon, by that way, i reaplace an unused object, then make weapon invisible, then put that object into the weapon's place) Meta.xml <meta> <info author="Kala" name="Custom weapons" description="Ez egy saját cuccos saját fegyókat csinálol vele :DD" type="play" /> <script src="client.lua" type="client" /> <file src="lib_street06.dff" /> <file src="lib_street06.txd" /> </meta> Client.lua function model() txd = engineLoadTXD ( "lib_street06.txd" ) engineImportTXD ( txd, 3907 ) dff = engineLoadDFF ( "lib_street06.dff" ) engineReplaceModel ( dff, 3907 ) end addEventHandler ( "onResourceStart", getRootElement(), displayLoadedRes ) function fegyo() local weapon = createWeapon("ak47") setWeaponAmmo(weapon, 120) setWeaponClipAmmo(weapon, 32) setWeaponState(weapon, firing) setElementAlpha(weapon, 0) local newGun = createElement(object, 3907) attachElements(weapon, newGun) end addCommandHandler("fegyver", fegyo) By the way, the word "fegyver" means weapon in Hungarian, and the word "fegyo" is something like gunny, or I don't know ^^ Link to comment
Revolt Posted January 3, 2016 Share Posted January 3, 2016 function model() txd = engineLoadTXD ( "lib_street06.txd" ) engineImportTXD ( txd, 3907 ) dff = engineLoadDFF ( "lib_street06.dff" ) engineReplaceModel ( dff, 3907 ) end addEventHandler ( "onClientResourceStart", resourceRoot, model ) function fegyo() local weapon = createWeapon("ak-47") setWeaponAmmo(weapon, 120) setWeaponClipAmmo(weapon, 32) setWeaponState(weapon, "firing") setElementAlpha(weapon, 0) local newGun = createElement(object, 3907) attachElements(weapon, newGun) end addCommandHandler("fegyver", fegyo) Try this. Link to comment
Kullancs Posted May 21, 2017 Share Posted May 21, 2017 Hello. I try make more guns like you but the script not working i ctry this script bit still not workin and no erros on debug but i cant use the guns. Any idea? 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