Jump to content

onPlayerWasted error


myyusuf

Recommended Posts

addEvent("onPlayerWasted") 
function player_Wasted() 
    for i,v in ipairs">ipairs(getElementsByType('player')) do 
        local rank = exports.race:getPlayerRank(source) 
  
        if(rank == 2) then 
  
            local pointsToDie = 5 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in second place and got #abcdef5 #c0c0c0points!", root, 255, 255, 255, true ) 
     
    elseif(rank == 3) then 
  
  
            local pointsToDie = 3 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in third place and got #abcdef3 #c0c0c0points!", root, 255, 255, 255, true ) 
  
        elseif(rank == 4) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 5) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 6) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 7) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == <!-- s8) --><img src=\"{SMILIES_PATH}/icon_cool.gif\" alt=\"8)\" title=\"Cool\" /><!-- s8) --> then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 9) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 10) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 11) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 12) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 13) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 14) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 15) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 16) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 17) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 18) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 19) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 20) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        elseif(rank == 21) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        elseif(rank == 22) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        elseif(rank == 23) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        elseif(rank == 24) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        elseif(rank == 25) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        elseif(rank == 26) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        elseif(rank == 27) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        elseif(rank == 28) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        elseif(rank == 29) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        elseif(rank == 30) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        end 
    end 
addEventHandler("onPlayerWasted", getRootElement(), player_Wasted) 
  
end 
end 

it isnt running. it give error on /debugscript 3. i dont know mean of this. can you help me please?

Edited by Guest
Link to comment
  • Moderators
addEvent ( "onPlayerWasted", true ) 
function player_Wasted() 
        local rank = exports.race:getPlayerRank(source) 
  
        if(rank == 2) then 
  
            local pointsToDie = 5 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in second place and got #abcdef5 #c0c0c0points!", root, 255, 255, 255, true ) 
     
    elseif(rank == 3) then 
  
  
            local pointsToDie = 3 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in third place and got #abcdef3 #c0c0c0points!", root, 255, 255, 255, true ) 
  
        elseif(rank > 3 and rank < 31) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
      
        elseif(rank > 30) then 
  
            local pointsToDie = 0 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        end 
  
  
  
end 
  
  
addEventHandler("onPlayerWasted", getRootElement(), player_Wasted) 
  
  
  
  
  
  
  
  
  
  
  

that handler I don't know: I am not sure if an event can also activate the trigger. Because the event does not have target the script... Can't you put handler out of the function?

If you trigger from other side client/server, can't you better use?

addEvent ( "onPlayerWasted", true )

Edited by Guest
Link to comment

*facepalm* I took a better look into the script

Here :

  
function bastardDied( player_Wasted ) 
        local rank = exports.race:getPlayerRank( player_Wasted ) 
  
        if(rank == 2) then 
  
            local pointsToDie = 5 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in second place and got #abcdef5 #c0c0c0points!", root, 255, 255, 255, true ) 
     
    elseif(rank == 3) then 
  
  
            local pointsToDie = 3 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in third place and got #abcdef3 #c0c0c0points!", root, 255, 255, 255, true ) 
  
        elseif(rank == 4) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 5) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 6) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 7) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == -- s8) --> then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 9) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 10) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 11) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 12) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 13) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 14) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 15) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 16) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 17) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 18) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 19) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
  
        elseif(rank == 20) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        elseif(rank == 21) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        elseif(rank == 22) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        elseif(rank == 23) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        elseif(rank == 24) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        elseif(rank == 25) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        elseif(rank == 26) then 
  
              local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        elseif(rank == 27) then 
    
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        elseif(rank == 28) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        elseif(rank == 29) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        elseif(rank == 30) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )      
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
     
        end 
    end 
addEventHandler("onPlayerWasted", getRootElement(), bastardDied) 
  
end 
end 
 

EDIT : It seems the editor goes weird..

Remove : "tonumber"> " from each line ..

That means instead of :

            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
 

It will bee :

            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 

'

And next time use [ lua][ /lua] tags..

Edited by Guest
Link to comment
  • Moderators

oh shut the fuck off you didn't even mark the things you changed and also you let the script much to long.

I don't get it how somebody from other side can trigger your script.

end

end

addEventHandler("onPlayerWasted", getRootElement(), bastardDied)

end

end

You also need to removed one end.> You removed inpairs

Edited by Guest
Link to comment

function bastardDied( player_Wasted ) 
        local rank = exports.race:getPlayerRank( player_Wasted ) 
  
        if(rank == 2) then 
  
            local pointsToDie = 5 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in second place and got #abcdef5 #c0c0c0points!", root, 255, 255, 255, true ) 
    
    elseif(rank == 3) then 
  
  
            local pointsToDie = 3 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in third place and got #abcdef3 #c0c0c0points!", root, 255, 255, 255, true ) 
  
  
        elseif(rank == 4) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 5) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 6) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 7) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank ==  then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 9) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 10) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 11) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 12) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 13) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 14) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 15) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 16) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 17) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 18) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 19) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 20) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 21) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 22) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 23) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 24) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 25) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 26) then 
  
              local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 27) then 
    
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 28) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 29) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 30) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        end 
    end 
addEventHandler("onPlayerWasted", getRootElement(), bastardDied) 
  
end 
end 
  
  
WARNING: Loading script failed: fuck-stats/server.lua:129'<eof>' expected near 'end' 

i have got this warning. can you help me?

Link to comment

function bastardDied( player_Wasted ) 
        local rank = exports.race:getPlayerRank( player_Wasted ) 
  
        if(rank == 2) then 
  
            local pointsToDie = 5 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in second place and got #abcdef5 #c0c0c0points!", root, 255, 255, 255, true ) 
    
    elseif(rank == 3) then 
  
  
            local pointsToDie = 3 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in third place and got #abcdef3 #c0c0c0points!", root, 255, 255, 255, true ) 
  
  
        elseif(rank == 4) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 5) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 6) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 7) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank ==  then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 9) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 10) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 11) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 12) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 13) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 14) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 15) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 16) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 17) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 18) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 19) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 20) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 21) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 22) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 23) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 24) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 25) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 26) then 
  
              local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 27) then 
    
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 28) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 29) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 30) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
        end 
end 
addEventHandler("onPlayerWasted", getRootElement(), bastardDied) 

 

Link to comment
function bastardDied( player_Wasted ) 
        local rank = exports.race:getPlayerRank( player_Wasted ) 
  
        if(rank == 2) then 
  
            local pointsToDie = 5 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in second place and got #abcdef5 #c0c0c0points!", root, 255, 255, 255, true ) 
    
    elseif(rank == 3) then 
  
  
            local pointsToDie = 3 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in third place and got #abcdef3 #c0c0c0points!", root, 255, 255, 255, true ) 
  
  
        elseif(rank == 4) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 5) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 6) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 7) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank ==  then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 9) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 10) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 11) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 12) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 13) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 14) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 15) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 16) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 17) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 18) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 19) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 20) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 21) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 22) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 23) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 24) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 25) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 26) then 
  
              local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 27) then 
    
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 28) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 29) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 30) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
        end 
end 
addEventHandler("onPlayerWasted", getRootElement(), bastardDied) 

 

thank you so much for answer. but it doesnt effect to "points". what can i do for that? :/

Link to comment
  • Moderators
function bastardDied( player_Wasted ) 
      outputChatBox ( "I am death", player_wasted, 255, 0, 255, true ) 
      local rank = exports.race:getPlayerRank( player_Wasted ) 
      outputChatBox ( rank, player_wasted, 255, 255, 0, true ) -- maybe this works or not... other it will just a warning. 
   
      if(rank > 0) then 
        outputChatBox ( "I have a rank", player_wasted, 0, 255, 255, true ) 
      end 
        if(rank == 2) then 
  
            local pointsToDie = 5 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in second place and got #abcdef5 #c0c0c0points!", root, 255, 255, 255, true ) 
    
    elseif(rank == 3) then 
  
  
            local pointsToDie = 3 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in third place and got #abcdef3 #c0c0c0points!", root, 255, 255, 255, true ) 
  
  
        elseif(rank == 4) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 5) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 6) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 7) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == -- s8) --> then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 9) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 10) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 11) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 12) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 13) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 14) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 15) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 16) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 17) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 18) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 19) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank == 20) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 21) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 22) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 23) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 24) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 25) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 26) then 
  
              local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 27) then 
    
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 28) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 29) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank == 30) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
        end 
end 
addEventHandler("onPlayerWasted", getRootElement(), bastardDied) 
 

 

Why don't you check your script first?

try this.

Link to comment

function bastardDied( player_Wasted ) 
      outputChatBox ( "I am death", player_wasted, 255, 0, 255, true ) 
      local rank12 = exports.race:getPlayerRank( player_Wasted ) 
      outputChatBox ( rank12, player_wasted, 255, 255, 0, true ) -- maybe this works or not... other it will just a warning. 
  
      if(rank12 > 0) then 
        outputChatBox ( "I have a rank", player_wasted, 0, 255, 255, true ) 
      end 
        if(rank12 == 2) then 
  
            local olme = 5 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan + olme )     
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in second place and got #abcdef5 #c0c0c0points!", root, 255, 255, 255, true ) 
    
    elseif(rank12 == 3) then 
  
  
            local olme = 3 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan + olme )     
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in third place and got #abcdef3 #c0c0c0points!", root, 255, 255, 255, true ) 
  
  
        elseif(rank12 == 4) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank12 == 5) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank12 == 6) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank12 == 7) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank12 ==  then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank12 == 9) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank12 == 10) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank12 == 11) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank12 == 12) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank12 == 13) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank12 == 14) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank12 == 15) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank12 == 16) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank12 == 17) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank12 == 18) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank12 == 19) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        elseif(rank12 == 20) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank12 == 21) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank12 == 22) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank12 == 23) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank12 == 24) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank12 == 25) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank12 == 26) then 
  
              local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank12 == 27) then 
    
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank12 == 28) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank12 == 29) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
        elseif(rank12 == 30) then 
  
            local olme = 1 
            local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", puan - olme )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
        end 
end 
addEventHandler("onPlayerWasted", getRootElement(), bastardDied) 

with this code i have this error.

attemp to perform aritmetic on local 'puan' (a nil value)

Link to comment
  • Moderators

well that means your export function does not work very well.....

This does not work:

local rank12 = exports.race:getPlayerRank( player_Wasted )

So put this script in race folder. Make sure you also change meta there.

and use:

local rank12 = getPlayerRank( player_Wasted )

:|

Does this not work.... than the rank script of race does not work like that.

... Don't be stuppit to write the operators like that...

  
-- in race folder 
function bastardDied( player_Wasted ) 
        local rank = getPlayerRank( player_Wasted ) 
  
        if(rank == 2) then 
  
            local pointsToDie = 5 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in second place and got #abcdef5 #c0c0c0points!", root, 255, 255, 255, true ) 
    
    elseif(rank == 3) then 
  
  
            local pointsToDie = 3 
            local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in third place and got #abcdef3 #c0c0c0points!", root, 255, 255, 255, true ) 
  
  
        elseif(rank > 3 and rank < 31) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        end 
end 
addEventHandler("onPlayerWasted", getRootElement(), bastardDied) 
 

Link to comment
well that means your export function does not work very well.....

This does not work:

local rank12 = exports.race:getPlayerRank( player_Wasted )

So put this script in race folder. Make sure you also change meta there.

and use:

local rank12 = getPlayerRank( player_Wasted )

:|

Does this not work.... than the rank script of race does not work like that.

... Don't be stuppit to write the operators like that...

  
-- in race folder 
function bastardDied( player_Wasted ) 
        local rank = getPlayerRank( player_Wasted ) 
  
        if(rank == 2) then 
  
            local pointsToDie = 5 
            local playerPoints = tonumber">tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in second place and got #abcdef5 #c0c0c0points!", root, 255, 255, 255, true ) 
    
    elseif(rank == 3) then 
  
  
            local pointsToDie = 3 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in third place and got #abcdef3 #c0c0c0points!", root, 255, 255, 255, true ) 
  
  
        elseif(rank > 3 and rank < 31) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        end 
end 
addEventHandler("onPlayerWasted", getRootElement(), bastardDied) 
  
 

in race folder same warning " attemp to perform aritmetic on local 'playerPoints' (a nil value) " :(

Link to comment
  • Moderators

First of all always put a handler... when must this ... script be activated.....

Second of all I have never used a return on my script. I always use else... I have no idea why use a return instead of using else.

........ why are you scripting so PRO and so not PRO....... You made that script or you just get it out of another script.

I don't get it. BE MORE CLEAR

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