Script.Parent.Touched:connect(function()
Script.Parent.BrickColor = BrickColor.new("Bright red")
end)
COMMUNITY QUESTION
Im VERY new to scripting, why does this not work?
1 answer
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.
1 comment
0
He knows. And yes, watch the output.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
oh.