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

Whats wrong with this script?

part = game.Workspace.T1
part2 = game.Workspace.T1two
part.Touched:connect(function(hit)
   part.BrickColor = BrickColor.new("Really red")
end)
part.TouchEnded:connect(function(hit)
   part.BrickColor = BrickColor.new("Medium stone grey")
end)

if 
script.Parent.BrickColor = ("Really red")	
	then
	script.Parent.Value.Value +1
end

It says something in it is nil.

1 comment

0

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

1 answer

What you did was correct (in the first half) after that you tried to change a brick color without repeating BrickColor.new, simple mistakes :P

You also didn't repeat the adding value, Roblox is weird like that. lol

part = game.Workspace.T1
part2 = game.Workspace.T1two
part.Touched:connect(function(hit)
   part.BrickColor = BrickColor.new("Really red")
end)
part.TouchEnded:connect(function(hit)
   part.BrickColor = BrickColor.new("Medium stone grey")
end)

if 
script.Parent.BrickColor = BrickColor.new("Really red")  
    then
    script.Parent.Value.Value  = script.Parent.Value.Value +1
end

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