Klesh Posted December 1, 2010 Share Posted December 1, 2010 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
Castillo Posted December 1, 2010 Share Posted December 1, 2010 first, i don't think you made this lines, second this is a mess of client side with server side, go back to basics. Link to comment
Klesh Posted December 1, 2010 Author Share Posted December 1, 2010 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
Castillo Posted December 1, 2010 Share Posted December 1, 2010 i don't have idea where you get those codes but they're all wrong and messed. as i said before, get back to basics. Link to comment
Klesh Posted December 1, 2010 Author Share Posted December 1, 2010 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
Aibo Posted December 1, 2010 Share Posted December 1, 2010 man, you cant even write straight, let alone script. and what is this topic about then: viewtopic.php?f=91&t=30325 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now