ViCe Posted December 15, 2011 Posted December 15, 2011 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..
Castillo Posted December 15, 2011 Posted December 15, 2011 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) 1
BinSlayer1 Posted December 15, 2011 Posted December 15, 2011 Post the meta.xml because that's where the problem is most likely It can't be the tostring thing because pname is already a string so it won't make any difference
ViCe Posted December 15, 2011 Author Posted December 15, 2011 Ok the meta.xml: <meta> <info author="ViCe" name="ResetScore" version="1.1" type="script" /> <script src="resetscore.lua" /> </meta>
BinSlayer1 Posted December 15, 2011 Posted December 15, 2011 Weird enough. Meta looks good too unless the script's name is not 'resetscore.lua' Do you think you could be doing anything wrong? Sometimes you can even miss loading the resource. (i'm not saying you're a noob, i'm just trying to think what could possibly go wrong)
PATRAOZINHO98 Posted September 25, 2021 Posted September 25, 2021 (edited) On 15/12/2011 at 07:05, Castillo said: 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) Castillo tien un resource para eso, o ya vien en los serve? ayudame emo porfavor, yo juegaba tu serve con Clone y hidden a mucho tiempo.donde estas (thePlayer) es para poner el login del player o solo el nick? Edited September 25, 2021 by PATRAOZINHO98
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