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

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

Asked by 4 years ago

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)
0
You forgot to add an 'end' after line 5. ScuffedAI 435 — 4y
0
The end is after line 5... satrasatra 8 — 4y

2 answers

Log in to vote
0
Answered by
Burobuu 18
4 years ago

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)

0
There is no parentheses next to the end on line 7 User#29913 36 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

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

script.Parent.Material = Enum.Material.Neon

Answer this question