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

How to script guis with lighting?

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

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.

1 comment

0

Oh, and note for later, if it doesn't work as a local script, make it a regular script.

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