Walid Posted April 19, 2015 Posted April 19, 2015 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 )
ALw7sH Posted April 19, 2015 Posted April 19, 2015 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
ALw7sH Posted April 19, 2015 Posted April 19, 2015 Can you put the code that when player will respawn?
TAPL Posted April 19, 2015 Posted April 19, 2015 It use "team" element data, not "Class". Also you might need a timer as the element data is set after spawning the player.
Xwad Posted April 19, 2015 Author Posted April 19, 2015 set timer for the spawn script or for the armor script?
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