Hi all
my friend made a script for resetting scores for the player , for ex: if a player killed 4 and deaths 10 , he should write /rest to reset all his scores in scoreboard to 0. such as "kills" and "deaths" and "dmg" , when I tried it , I wroted /rest and nothing happens ..
can anyone check please if the script correct or there are an erros ..
function resetPlayerScore (thePlayer)
local pname = getPlayerName(thePlayer)
setElementData(thePlayer,"Score",0)
setElementData(thePlayer,"kills",0)
setElementData(thePlayer,"deaths",0)
setElementData(thePlayer,"dmg",0)
setElementData(thePlayer,"Damage",0)
setElementData(thePlayer,"level",0)
setElementData(thePlayer,"exp",0)
outputChatBox(pname.." has resetted his score.", getRootElement(), 147, 112, 219, true )
end
addCommandHandler("rest", resetPlayerScore)
Thanks..