Bean666 Posted January 28, 2015 Share Posted January 28, 2015 hi guys , today i made a script , a player can only have access to a skin if he's level 20 , when i click the button , it triggers this event. when i clicked the button it changes my skin even i dont have level 20 . can u guys help me? local nLevel = tonumber( getElementData( player, "level" ) ) or 0; addEvent("supersoldier",true) addEventHandler("supersoldier",root, function() if ( nLevel < 20 ) then setPedSkin ( source, 285 ) else outputChatBox('You don\'t have the requirements of the supersoldier!', source, 255, 0, 0 ) end end) Link to comment
Banex Posted January 28, 2015 Share Posted January 28, 2015 addEvent("supersoldier",true) addEventHandler("supersoldier",root, function() local nLevel = tonumber( getElementData( source, "level" ) ) or 0 if ( nLevel < 20 ) then setElementModel( source, 285 ) else outputChatBox('You dont have the requirements of the supersoldier!', source, 255, 0, 0 ) end end) Link to comment
TAPL Posted January 28, 2015 Share Posted January 28, 2015 addEvent("supersoldier", true) addEventHandler("supersoldier", root, function() local nLevel = tonumber(getElementData(source, "level")) or 0 if (nLevel >= 20) then setElementModel(source, 285) else outputChatBox("You don't have the requirements of the supersoldier!", source, 255, 0, 0) end end) Link to comment
LaCosTa Posted January 28, 2015 Share Posted January 28, 2015 You made if nLevel < 20 which means , he can get the skin if his level is lower than 20 , you should use the greater and equal operator as TAPL gave you 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