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

Im VERY new to scripting, why does this not work?

Asked by 10 years ago
Script.Parent.Touched:connect(function()


    Script.Parent.BrickColor = BrickColor.new("Bright red")     


end)
0
oh. HypervenomPhantomz 0 — 10y

1 answer

Log in to vote
1
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

Variable names are case-sensitive. For whatever reasons, script is only provided as the lowercase script. (This is because the convention for Lua names is camelCase while the convention for ROBLOX objects is PascalCase -- script, as a variable and not the name of an object uses the Lua convention)


Use script instead of Script.


Your output would have hinted this to you! Learn to use your output! It would have said something like

attempt to index a 'nil' value, 'Script'

Which would mean there is no variable named Script.

0
He knows. And yes, watch the output. OniiCh_n 410 — 10y
Ad

Answer this question