ID:1803102
 
(See the best response by Nadrew.)
Code:
proc
updateScoreOrange()
var/ORANGESCORE = TeamO
for(var/obj/event/Orangescore/S in world)
S.icon_state=num2text(ORANGESCORE)


Problem description: I have to make an icon state for every single point, and the event ends at 200 points, its very tedious to make 200 icon states... so if there's an easy way to do the same thing maybe a different code?

mob/proc
addname(var/text)
for(var/i=1,i<=length(text),i++)
var/obj/N=new/obj/name
N.icon_state="[copytext(text,i,i+1)]"
src.overlays+=N

obj/name
icon='text.dmi'
icon_state=""
layer=MOB_LAYER+100

I have this code from a demo that i forgot about (so credits to the creator for that) but is there a way to edit this to make the scores? This makes the name and i dont have to make an icon state for each name it just adds the letters to what you type in.
Take a look at the maptext variable.
I dont get it, i looked through it but dont understand which one to use or how to apply it on here
Best response
Instead of having to manually draw the text using icons you just need to apply maptext to an existing atom, ideally a screen object. In the case of the code you posted it looks like you want to simply show the value of 'ORANGESCORE' on the screen.

obj/score
proc/Update()
maptext = "[ORANGESCORE]"


That will set the maptext anytime you call Update() on /obj/score, now all you have to do is add some options for showing it on the screen.

obj/score
screen_loc = "1,10" // Read up on screen_loc for more.


Since the object can be shared across everyone in the game, there's only the need to really create it once.
var/obj/score/orange_score = new()

mob/Login()
..()
if(client) client.screen += orange_score


Then, when something updates ORANGESCORE you just have to do.

if(orange_score) orange_score.Update()


And it'll update for every player logged in, no need for loops or anything.
Ohh ok cool, that makes a lot more sense thank you