#My traffic light blink script will not work.

1 messages · Page 1 of 1 (latest)

half grove
raw monolithBOT
#

studio** You are now Level 7! **studio

bitter grove
#

i have a theory why it doesn't work thonkoof

tough sparrow
half grove
#

it should work, it don't..

tough sparrow
half grove
#

and whats that theory?

tough sparrow
#

i think you are using too many lines man

#

im sorry but no one will try to read one thousand lines

half grove
#

its only towards the bottom that doesnt work

#

let me paste the exact part

errant oasis
wraith nebula
#

structure it something more like this

#

local greenLight = [green light here]
local yellowLight = [yellow light here]
local redLight = [red light here]

function enable(light)
    greenLight.Enabled = false
    yellowLight.Enabled = false
    redLight.Enabled = false

    light.Enabled = false
end

-- your determining algorithm here, the above code just makes sure lights are flipped off except the one you want on, and if they're not, the problem's in the determination

#

and please, use some real variable names 😭

#

nobody knows what D1S and D1L and D1R is

#

overall just learn OOP

#

sounds scary, it was for me, but it's much easier than it looks and very useful

#

oh holy shit its way more code than i thought

half grove
#

and theres I think 10-15 lights in the entire thing

#

not just 3

tough sparrow
#

this is like trying to understand chinese without knowing chinese

#

so way long

#

and what the hell is D1S D1L

half grove
#

Idk

tough sparrow
#

no one can fix this