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

I want a block to light up but it won't. Know how to improve the script?

So the code I used is under this text, and I don't understand why it won't work. Can anybody help improve or fix the script?

function OnClicked(C)
	if C then script.Parent.Parent.Next.PointLight.Brightness = 13
		script.Parent.Parent.a.SurfaceLight.Shadows = false
		wait(2)
		script.Parent.Parent.Next.PointLight.Brightness = 0
end

script.Parent.ClickDetector.MouseClick:connect(OnClicked)

2 comments

0

You forgot to add an 'end' after line 5.

0

The end is after line 5...

2 answers

Like the comments said, you need to add an "end" at the end of line 5. So...

function OnClicked(C)
    if C then script.Parent.Parent.Next.PointLight.Brightness = 13
        script.Parent.Parent.a.SurfaceLight.Shadows = false
        wait(2)
        script.Parent.Parent.Next.PointLight.Brightness = 0
	end
end)

script.Parent.ClickDetector.MouseClick:connect(OnClicked)

1 comment

0

There is no parentheses next to the end on line 7

Or you could make the part neon. Insert a script into the part:

script.Parent.Material = Enum.Material.Neon

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