Trying to replicate a old arcade game display score

Im currently working on a retro inspired game and i was just wondering is it possible to recreate a scoring display that involves 6 digits and numbers that only count in the front, for example: i want it to start out: 000000, and when you score it goes up to 001000.

This is what im talking about here:
Screenshot 2025-03-20 151233

I tried to search the forums for a answer but i couldn’t find any, i need some help on how to do this.

3 Likes

yeah its definitely possible to recreate that display but it will require a knowledgeable understanding of string manipulation and formatting and basic math operations.

3 Likes

Actually never mind there is a much easier idea i thought about .
Try this code when updating the score textlabel:
local scoreBonus=1000 --any number
local currentScore= script.Parent.Text–Your score already
local score=math.clamp(currentscore,000000,999999) – your min and max value can be anything
script.Parent.Text=currentScore+score --Dont worry strings and numbers add together depending on the string is representation

2 Likes

Just format the textlabel text initially like “000000” or in a script write a variable with the number value 000000

2 Likes

I tried that and it only gave me the numbers I put in the currentscore

2 Likes

can you show me a video or picture

3 Likes

Screenshot 2025-03-20 171134
Screenshot 2025-03-20 171150

2 Likes

change min value in math.clamp to 000000

3 Likes

i tried that and it stayed the same

2 Likes

yeah because you havent initially set the textlabel text value

3 Likes

Try setting it to 000000 first

3 Likes

i did though and its still not working

1 Like

Actually my bad it has to be a decimal to add.Also it would be easier to replace with strings the number ill grab my script and paste it

2 Likes

I mean this is a very basic example but should work, why not just use conditionals to check the score amount and concatenate it with the textlabel? Like this:

inital_text = "000000"

if (value >= 0 and < 10) then --000001 -> --000009
	inital_text = "SCORE".."00000"..value
elseif (value >= 10 and value < 100) then --000010 -> --000099
	inital_text = "SCORE".."0000"..value
elseif (value >= 100 and value < 1000) then --000100 -> --000999
	inital_text = "SCORE".."000"..value
elseif (value >= 1000 and value < 10000) then --001000 -> --009999
	inital_text = "SCORE".."00"..value
elseif (value >= 10000 and value < 100000) then --010000 -> --099999
	inital_text = "SCORE".."0"..value
else --100000 -> --999999
	inital_text = "SCORE"..value
end

Im sure you can make this in a loop or something or some alternate way to suit your lazy typing fingers. But I’m not too sure if any math equation will work, since any number like “001” will just turn to “1”, or any number like “000” will turn to “0”.

4 Likes

yeah thats basically the script i created but using string.format there really isnt a simpler quick way to do it

3 Likes

alright ill try this and get back to you

1 Like
--local script test for arcade style 
local player = game.Players.LocalPlayer
local gui = Instance.new("ScreenGui", player.PlayerGui)
local label = Instance.new("TextLabel", gui)

label.Size = UDim2.new(0, 200, 0, 70)
label.Position = UDim2.new(0.5, -100, 0, 20)
label.BackgroundTransparency = 1
label.TextScaled = false
label.Font = Enum.Font.Arcade
label.TextColor3 = Color3.new(1, 1, 1)
label.TextXAlignment = Enum.TextXAlignment.Left
label.TextYAlignment = Enum.TextYAlignment.Top
label.TextSize = 24

local score = 25
label.Text = string.format("SCORE\n%06d", score)

Should look right no matter what the score is…

3 Likes

Oh dang I didn’t know robox had something like printfs

1 Like

this actually works, thank all of you guys for helping me in the thread

1 Like