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

How to script guis with lighting?

Asked by
Danfly 5
10 years ago

Does anyone have a script or will be able to help me with this? I am trying to make a gui that is a 1 tab when you click it the light turns on, when you click it again the light turns off.

Thanks :)

1 answer

Log in to vote
0
Answered by 10 years ago

I'm not going to go out of my way to make something, but here's what it should look like:

Create a GUI button, put a local script in it. create a block or something and put a light source in it.

Put this in the button's script:

light = --Put path to light here


function onClicked()

    if light.Enabled == true then
        light.Enabled = false
    else
        light.Enabled = true
    end

end

script.Parent.MouseButton1Down:connect(onClicked)

You'll have to iron out the details, but this is basically how it should look.

0
Oh, and note for later, if it doesn't work as a local script, make it a regular script. notRezznov 35 — 10y
Ad

Answer this question