Jump to content

Winscoreboard


Klesh

Recommended Posts

I do a script for race, all works fine excep the the races wins.

here is the code

localPlayer = getLocalPlayer() 
  
function addColumns() 
exports.scoreboard:scoreboardAddColumn("Wins")   
  
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), addColumns) 
  
    local playerMoney = getPlayerMoney(source) 
    local playerPoints = getElementData(getLocalPlayer(), "Points") 
    local playerWin = getElementData(getLocalPlayer(), "Wins")    
    local playerWashted = getElementData(getLocalPlayer(), "Deaths") 
  
end 
  
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) 
addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin ) 
  
addEvent( "onPlayerWin", true ) 
function onPlayerWin() 
        givePlayerMoney(winner, 1200) 
        outputChatBox(getPlayerName ( win ) .. " has won $1200 as last player alive",getRootElement(),0,255,0) 
        setElementData(wins,"Points",tonumber(getElementData(win,"Points"))+2)       
    setElementData(wins,"Wins",tonumber(getElementData(wins,"Wins"))+1)      
end) 
  

Only is the wins because the deaths and money works fine.

Plz help when the player wins this no adds to scoreboard

Example Klesh is the final survivor and in the scoreboard appears +1 wins

Link to comment
addEventHandler("onPlayerFinish", rootElement, raceWin )  
  
addEventHandler("onPlayerFinish",getRootElement(), 
        givePlayerMoney(Wins, 1200) 
        outputChatBox(getPlayerName ( Wins ) .. " has won $1200 as last player alive",getRootElement(),0,255,0) 
        setElementData(wins,"Points",tonumber(getElementData(win,"Points"))+2)       
    setElementData(source,"Wins",tonumber(getElementData(source,"Wins"))+1)      
end) 
  

what not works?

Link to comment

from your script userpanel because your race wins in scoreboard no works and i trying to modify to works, but why you ondestruccionwin? that function exist, what another function can replace ondestruccionderbwin, like

onPlayerFinish 
onPlayerRaceFinish 

but this is for checkpoint and is for destruccion derby mode.

some function to replace

OnDestruccionWin 

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