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

Police Lights Scripting Problem?

Hello, I'm just new to scripting and I'm trying to do basic things first. So, here's what I did and I got some error I still can't fix.

while true do 
	Script.Parent.Transparency = 0.5
	wait(0.15)
	Script.Parent.Transparency = 0
	wait(0.15)
	Script.Parent.Transparency = 0.5
	wait(0.15)
	Script.Parent.Transparency = 0
	wait(0.15)
end

After I test it, it doesn't work and it shows something in the output (of course it would show some script problem -_-) that I can't seem to understand.

20:48:39.641 - Workspace.Red Light Bar.Script:2: attempt to index global 'Script' (a nil value) 20:48:39.642 - Stack Begin 20:48:39.643 - Script 'Workspace.Red Light Bar.Script', Line 2 20:48:39.643 - Stack End

(Bold text is the error which is red in ROBLOX Studio.)

2 answers

✓ Accepted answer

script should never be capitalized.

while true do 
    script.Parent.Transparency = 0.5
    wait(0.15)
    script.Parent.Transparency = 0
    wait(0.15)
    script.Parent.Transparency = 0.5
    wait(0.15)
    script.Parent.Transparency = 0
    wait(0.15)
end

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