Jump to content

armor script not working:/


Xwad

Recommended Posts

Posted

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 ) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
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

Posted

It use "team" element data, not "Class". Also you might need a timer as the element data is set after spawning the player.

CiTLh.png

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