How to make a countdown TextLabel?

Make the decal’s parent nil, so that it removes it when it is off, since they are decals you must remove it so that it doesn’t show, unless you want something else?

It’s working! Thank you! :slight_smile:

Apart from one thing, only one of the lights work. :thinking:
image

This is the script for the broken one:

local textLabel = game.Workspace.Light2.Timer.SurfaceGui.TextLabel2
local green = game.Workspace.Light2.GreenMan.Decal
green.Parent = nil
local red = game.Workspace.Light2.RedMan.Decal
script.Parent.MouseClick:Connect(function()
	green.Parent = red.Parent
	red.Parent = nil
	script.Parent.MaxActivationDistance = 0
		script.Parent.MaxActivationDistance = 0
		for i = 15,0,-1 do
			textLabel.Text = i
			wait(1)
		end
	red.Parent = green.Parent
	green.Parent = nil
	textLabel.Text = ""
	script.Parent.MaxActivationDistance = 5
end)

I am totally lost here, lol.

What are all the buttons, what are all the lights, what are all the scripts. Can you tell everything you have so I can understand what the issue is? And also can you explain exactly what you want to script and how you want it to work? (Explain the system of how it’s supposed to work) This way I can tell you everything you need to do properly.

image
image
image

All in Light1

image

And how is it supposed to work? Example:
You click the button, it becomes green then after the countdown it becomes red then click again and repeat.

Basically I want to know what you would like so I can help you with the script accordingly.

@ZOMBEIVEroblox There is a problem, the decal replaces the red man, I want it so it just disables it from being visible like this:

image
(not clicked)

image
(clicked)

@ZOMBEIVEroblox making sure you saw

Maybe this will work, maybe not, I have no idea, but here goes:

Step 1: Parent the decal in GreenMan to ServerStorage.

Step 2: Put this script in the click detector:

local ServerStorage = game:GetService("ServerStorage")
local light1 = game.Workspace.Light1
local textLabel = light1.Timer.SurfaceGui.TextLabel
local greenMan = light1.GreenMan
local greenDecal = ServerStorage.Decal
local redMan = light1.RedMan
local redDecal = redMan.Decal
script.Parent.MouseClick:Connect(function()
    script.Parent.MaxActivationDistance = 0
    redDecal.Parent = ServerStorage
    greenDecal.Parent = greenMan
    for i = 30,1,-1 do
        textLabel.Text = tostring(i)
    end
    greenDecal.Parent = ServerStorage
    redDecal.Parent = redMan
    textLabel.Text = ""
    script.Parent.MaxActivationDistance = 5
end)

Doesn’t work, the output says

  09:32:47.559  Decal is not a valid member of Part "Workspace.Light1.GreenMan"

Which script is that error coming from? And which line? It should say next to the error.

The timer doesn’t work now? What’s happened?

This is the Light1 script:

local ServerStorage = game:GetService("ServerStorage")
local light2 = game.Workspace.Light2
local textLabel = light2.Timer.SurfaceGui.TextLabel
local greenMan = light2.GreenMan
local greenDecal = ServerStorage.Green
local redMan = light2.RedMan
local redDecal = redMan.Red
script.Parent.MouseClick:Connect(function()
    script.Parent.MaxActivationDistance = 0
    redDecal.Parent = ServerStorage
    greenDecal.Parent = greenMan
    for i = 30,1,-1 do
        textLabel.Text = tostring(i)
    end
    greenDecal.Parent = ServerStorage
    redDecal.Parent = redMan
    textLabel.Text = ""
    script.Parent.MaxActivationDistance = 5
end)

This is the Light2 script:

local ServerStorage = game:GetService("ServerStorage")
local light1 = game.Workspace.Light1
local textLabel = light1.Timer.SurfaceGui.TextLabel
local greenMan = light1.GreenMan
local greenDecal = ServerStorage.Green
local redMan = light1.RedMan
local redDecal = redMan.Red
script.Parent.MouseClick:Connect(function()
	script.Parent.MaxActivationDistance = 0
	redDecal.Parent = ServerStorage
	greenDecal.Parent = greenMan
	for i = 30,1,-1 do
		textLabel.Text = tostring(i)
	end
	greenDecal.Parent = ServerStorage
	redDecal.Parent = redMan
	textLabel.Text = ""
	script.Parent.MaxActivationDistance = 5
end)

Maybe try putting the light1 script in light2 and the light2 script in light1

It stays on green now and the timer doesnt work.

Can you show me your explorer?

image

Why is the script named ‘Light1’ but it’s in Light2?

Well I don’t know what the issue is with the script, I’m sorry!

Also sorry for being days late.