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

Police Lights Scripting Problem?

Asked by 10 years ago

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

Log in to vote
0
Answered by 10 years ago

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
Ad
Log in to vote
-1
Answered by 10 years ago

'script' has to start with a lowercase s.

Answer this question