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

What Is Wong With My Light Script?

It's not flashing every second as I want it to do. I'm not sure what I am doing wrong it just wont flicker... Thanks for helping!

RedButton1 = game.Workspace.RedButton.PointLight.Enabled

while true do
	RedButton1 = true
	wait(1)
	RedButton1 = false
	wait(1)
end

1 answer

✓ Accepted answer

You can't set a variable directly to a property. You'll only receive the value of the property.

RedButton1 = game.Workspace.RedButton.PointLight.Enabled
print(RedButton1)				-- Output: "false" rather than the property name

while true do
	RedButton1 = true
	wait(1)
	RedButton1 = false
	wait(1)
end

To fix this, just have a variable of the object instead.

RedButton1 = game.Workspace.RedButton.PointLight
print(RedButton1)				-- Output: "PointLight"

while true do
	RedButton1.Enabled = true
	wait(1)
	RedButton1.Enabled = false
	wait(1)
end

2 comments

0

Thank you so much

0

You're welcome.

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