Jump to content

Level?


Bean666

Recommended Posts

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
  
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
  • Other Languages Moderators
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

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