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

Whats wrong with this script?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
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.

0
Please make your question title relevant to your question content. It should be a one-sentence summary in question form. AmericanStripes 610 — 9y

1 answer

Log in to vote
1
Answered by
NotSoNorm 777 Moderation Voter
9 years ago

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
Ad

Answer this question