Jump to content

Level&Exp Script Error !


Recommended Posts

Game Loser Players And Winner Players Give Exp For Script Codes Give Me Please

Sample Win Players :

  
addEvent ( "onPlayerDestructionDerbyWin", true ) 
addEventHandler ( "onPlayerDestructionDerbyWin", root, 
    function ( winner ) 
        local randomExp = math.random ( 10, 30 ) 
        exports [ "Level" ]:addPlayerEXP ( winner, randomExp ) 
        outputChatBox ( getPlayerName ( winner ) .." has won ".. randomExp .." experience for winning the map!", root, 0, 255, 0 ) 
    end 
) 

LOSE PLAYERS??

Link to comment
addEvent ( "onPlayerRaceWasted", true ) 
addEventHandler ( "onPlayerRaceWasted", root, 
    function ( ) 
        local rank = tonumber ( getElementData ( source, "race rank" ) ) 
        if ( rank and rank ~= 1 ) then 
            local randomExp = math.random ( 5, 10 ) 
            exports [ "Level" ]:addPlayerEXP ( source, randomExp ) 
            outputChatBox ( getPlayerName ( source ) .." has won ".. randomExp .." experience for finishing ".. rank .."!", root, 255, 255, 0 ) 
        end 
    end 
) 

Link to comment
addEvent ( "onPlayerRaceWasted", true ) 
addEventHandler ( "onPlayerRaceWasted", root, 
    function ( ) 
        local rank = tonumber ( getElementData ( source, "race rank" ) ) 
        outputChatBox ( "Your rank is: ".. tostring ( rank ), source ) 
        if ( rank and rank ~= 1 ) then 
            local randomExp = math.random ( 5, 10 ) 
            exports [ "Level" ]:addPlayerEXP ( source, randomExp ) 
            outputChatBox ( getPlayerName ( source ) .." has won ".. randomExp .." experience for finishing ".. rank .."!", root, 255, 255, 0 ) 
        end 
    end 
) 

Use that and tell me what it says on chat.

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