Dealman Posted December 30, 2014 Share Posted December 30, 2014 <meta> <script src="script.lua" type="client/server"/> </meta> That's all you really need in the meta for a testing resource. If it still doesn't work it's probably the script itself. Debug it and look for errors and warnings. Link to comment
Xwad Posted December 30, 2014 Author Share Posted December 30, 2014 not working:( Nut need i create only 1 lua file? Link to comment
Xwad Posted December 30, 2014 Author Share Posted December 30, 2014 i have write this in the .lua file is it good? local weaponsToDamageRhino = { [35] = true, -- basis RPG [36] = true, -- Heatseaking RPG -- You can add different weapons too apart from RPG, if not then a table isn't necessarily needed. -- The [number] is the weapon ID, true means it's valid, every other number returns false. } function handleRhinoDamage(attacker, weapon, loss, x, y, z, tyre) if (weapon and getElementModel(source) == 432 and loss > 0) then -- if the weapon exists and the vehicle being shot is a Rhino and -- the damage dealt isn't 0 but any number higher then do the following. if (weaponsToDamageRhino[weapon]) then -- if the weapon is one of the valid ID's above (35 'true' and 36 'true') then do the following. setElementHealth(source, getElementHealth(source) - loss) -- set the health (life points) of the Rhino (source is the vehicle being shot) -- too the current health minus the loss. end end end addEventHandler("onClientVehicleDamage", root, handleRhinoDamage) 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