The script seems to be fine.
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(tostring(pname) .." has resetted his score.", getRootElement(), 147, 112, 219, true )
end
addCommandHandler("rest", resetPlayerScore)