[UCG]Mike Posted August 3, 2014 Share Posted August 3, 2014 i want SCORES resource guys who have ? Link to comment
Anubhav Posted August 3, 2014 Share Posted August 3, 2014 exports.scoreboard:addScoreboardColumn('Score') addEventHandler("onPlayerWasted", root, function(attacker,attackerweapon) setElementData( attacker, "Score", getElementData(attacker,"Score")+1) setElementData( source, "Score", getElementData(source,"Score")-1) end ) Link to comment
[UCG]Mike Posted August 3, 2014 Author Share Posted August 3, 2014 What is the problem ?? Link to comment
Et-win Posted August 3, 2014 Share Posted August 3, 2014 exports.scoreboard:addScoreboardColumn('Score') addEventHandler("onPlayerWasted", root, function(attacker,attackerweapon) if (getElementData(attacker, "Score") == false) or (getElementData(attacker, "Score") == nil) then setElementData(attacker, "Score", 1) setElementData(source, "Score", -1) else setElementData( attacker, "Score", getElementData(attacker,"Score")+1) setElementData( source, "Score", getElementData(source,"Score")-1) end ) He forgot to check or the data even exists. Link to comment
Anubhav Posted August 3, 2014 Share Posted August 3, 2014 Whoops . I never tested that script lel!!! Thanks for correcting anywas.. Link to comment
[UCG]Mike Posted August 3, 2014 Author Share Posted August 3, 2014 exports.scoreboard:addScoreboardColumn('Score') addEventHandler("onPlayerWasted", root, function(attacker,attackerweapon) if (getElementData(attacker, "Score") == false) or (getElementData(attacker, "Score") == nil) then setElementData(attacker, "Score", 1) setElementData(source, "Score", -1) else setElementData( attacker, "Score", getElementData(attacker,"Score")+1) setElementData( source, "Score", getElementData(source,"Score")-1) end ) He forgot to check or the data even exists. its bug too Link to comment
Anubhav Posted August 3, 2014 Share Posted August 3, 2014 exports.scoreboard:addScoreboardColumn('Score') addEventHandler("onPlayerWasted", root, function(attacker,attackerweapon) if getElementData(attacker, "Score") == false or getElementData(attacker, "Score") == nil then setElementData(attacker, "Score", 1) setElementData(source, "Score", -1) else setElementData( attacker, "Score", getElementData(attacker,"Score")+1) setElementData( source, "Score", getElementData(source,"Score")-1) end ) Link to comment
[UCG]Mike Posted August 3, 2014 Author Share Posted August 3, 2014 exports.scoreboard:addScoreboardColumn('Score') addEventHandler("onPlayerWasted", root, function(attacker,attackerweapon) if getElementData(attacker, "Score") == false or getElementData(attacker, "Score") == nil then setElementData(attacker, "Score", 1) setElementData(source, "Score", -1) else setElementData( attacker, "Score", getElementData(attacker,"Score")+1) setElementData( source, "Score", getElementData(source,"Score")-1) end ) no bro its not work No supporters or Moderators here ? Link to comment
Et-win Posted August 3, 2014 Share Posted August 3, 2014 exports.scoreboard:addScoreboardColumn('Score') addEventHandler("onPlayerWasted", root, function(attacker,attackerweapon) if (getElementData(attacker, "Score") == false) or (getElementData(attacker, "Score") == nil) then setElementData(attacker, "Score", 1) setElementData(source, "Score", -1) else setElementData( attacker, "Score", getElementData(attacker,"Score")+1) setElementData( source, "Score", getElementData(source,"Score")-1) end end ) Forgot end Link to comment
Addlibs Posted August 3, 2014 Share Posted August 3, 2014 Wrong assumption that the 1st parameter of 'onPlayerWasted' is 'attacker'; where infact it is the totalAmmo (int). Link to comment
Et-win Posted August 3, 2014 Share Posted August 3, 2014 How stupid that I didn't see that, lol. 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