Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

help with variables?

Asked by
3x6x0 0
8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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
0
it doesnt work 3x6x0 0 — 8y
0
I think its should be more RedLight.Enabled = true you inverse them ScripterGame 145 — 8y
0
code block pls XToonLinkX123 580 — 8y
0
HERES CODE BLOCK 3x6x0 0 — 8y

3 answers

Log in to vote
2
Answered by 8 years ago

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^

0
thx i did enabled first bc of uristmcsparks so ye 3x6x0 0 — 8y
Ad
Log in to vote
0
Answered by
iSvenDerp 233 Moderation Voter
8 years ago

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:)

0
Also put your code in lua block. iSvenDerp 233 — 8y
Log in to vote
0
Answered by
3x6x0 0
8 years ago

i missed a wait

0
lol 3x6x0 0 — 8y

Answer this question