Jump to content

Need help with replacing weapon lua


Recommended Posts

 function ( "> replacing the shotg weapon" ) 
  
txd = engineLoadTXD ( "data/shotg.txd" ) 
engineImportTXD ( txd, 22 ) 
end  

whats wrong with it ??

i want to replace any weapon ( because i dont know the weapons ID ) i choosed 22 and i think its m4 :( with my txd shotg

whats wrong with it ? its not working :(

and if its wrong .. i am still new in scripting.

Link to comment
function replaceFunction( ) 
txd = engineLoadTXD ( "data/shotg.txd" ) 
engineImportTXD ( txd, 22 ) 
end  
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),replaceFunction) 

In your meta.xml you must have the right data "data/shotg.txd".

Link to comment

This is it ! check it if there is some thing wrong !

shotg.lua

function replaceFunction( ) 
    txd = engineLoadTXD ( "data/shotg.txd" ) 
    engineImportTXD ( txd, 22 ) 
    end 
    addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),replaceFunction) 

meta.xml

<meta> 
<info author="SonicTheHedgehog" type="Weapon" name="ShotG" /> 
<script src="shotg.lua" type="client" /> 
<file src="data/shotg.txd" type="client" /> 
</meta> 

Lol sorry again

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...