Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

help with variables?

i try using this it doesnt work

local RedLight = game.Workspace.StartLight.startLight.RedModel.LightBulb.PointLight
local YellowLight = game.Workspace.StartLight.startLight.YellowModel.LightBulb.PointLight
local GreenLight = game.Workspace.StartLight.startLight.GreenModel.LightBulb.PointLight

wait(3)

Enabled.RedLight = true

wait(3)

Enabled.RedLight = false

wait(3)

Enabled.YellowLight = true

wait(3)

Enabled.YellowLight = false

wait(3)

Enabled.GreenLight = true

Enabled.GreenLight = false

4 comments

0

it doesnt work

0

I think its should be more RedLight.Enabled = true you inverse them

0

code block pls

0

HERES CODE BLOCK

3 answers

✓ Accepted answer

There is your error : You reverse the Enabled with your variables. Its like you write the variable was Enabled

Your Code :

local RedLight = game.Workspace.StartLight.startLight.RedModel.LightBulb.PointLight
local YellowLight = game.Workspace.StartLight.startLight.YellowModel.LightBulb.PointLight
local GreenLight = game.Workspace.StartLight.startLight.GreenModel.LightBulb.PointLight

wait(3)

Enabled.RedLight = true

wait(3)

Enabled.RedLight = false

wait(3)

Enabled.YellowLight = true

wait(3)

Enabled.YellowLight = false

wait(3)

Enabled.GreenLight = true

Enabled.GreenLight = false

Code fix :

local RedLight = game.Workspace.StartLight.startLight.RedModel.LightBulb.PointLight
local YellowLight = game.Workspace.StartLight.startLight.YellowModel.LightBulb.PointLight
local GreenLight = game.Workspace.StartLight.startLight.GreenModel.LightBulb.PointLight

wait(3)

RedLight.Enabled = true

wait(3)

RedLight.Enabled = false

wait(3)

YellowLight .Enabled= true

wait(3)

YellowLight.Enabled = false

wait(3)

GreenLight.Enabled = true

GreenLight.Enabled = false

If its helped you accept my awnser please for peoples see this question is done.

Sorry for my bad grammar ^o^

1 comment

0

thx i did enabled first bc of uristmcsparks so ye

Hi...(im on mobile)this is a simple fix...Since you are using enabled you must use Variable.Enabled

local RedLight = game.Workspace.StartLight.startLight.RedModel.LightBulb.PointLight local YellowLight = game.Workspace.StartLight.startLight.YellowModel.LightBulb.PointLight local GreenLight = game.Workspace.StartLight.startLight.GreenModel.LightBulb.PointLight

wait(3)

RedLight.Enabled = true

wait(3)

RedLight.Enabled = false

wait(3)

YellowLight.Enabled = true

wait(3)

YellowLight.Enabled = false

wait(3)

GreenLight.Enabled = true

Greenlight.Enabled = false

Hope this helped let me know if it did:)

1 comment

0

Also put your code in lua block.

This discussion is preserved as it was. New answers, comments, and votes are closed.