Jump to content

armor script not working:/


Xwad

Recommended Posts

Try to use

addEventHandler("onPlayerSpawn", root, 
function() 
    if getElementData(source, "team") == "Heavy" then 
      setPedArmor(source, 100) 
else 
setPedArmor(source, 0) 
    end 
end) 

or you need to add something like this in s_main.lua

setElementData(client,"Class",class.name ) 

Link to comment
The code is 100% right, Where you set "Class" element data

??? lol there is no element data called "Class" in this script : https://community.multitheftauto.com/?p=resources&s=details&id=1152

only this is working but it gives the armor higgledy-piggledy sometimes it gives the armor for other classes.. And no debugscript.
  
addEventHandler('onPlayerSpawn',root, 
function ()     
if getElementData( source, 'Class' ) == 'Heavy' then      setPedArmor( source,100 )     
end 
end ) 
  

if getElementData( source, 'Class' ) == 'Heavy' then      setPedArmor( source,100 )    

---

Xwad you haven't answerd me, where do you set "Class" element dada

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...