var1 = Instance.new("Part",workspace) var1.Position = Vector3.new(0,0,0) var1.Name = "Testing" wait(3) var1.BrickColor = BrickColor.new("Really red") var1.Transparency = 0.7 var1.Anchored = True wait(5) if game.Workspace.Testing.Anchored == true then game.Workspace.Testing.BrickColor = BrickColor.new("Black") end
You almost had it there in your if
statement.
You actually had the way you do it earlier in your code.
var1 = Instance.new("Part",workspace) var1.Position = Vector3.new(0,0,0) var1.Name = "Testing" wait(3) var1.BrickColor = BrickColor.new("Really red") -- Similar to this. var1.Transparency = 0.7 var1.Anchored = true if game.Workspace.Testing.Anchored == true then -- Missing a '=' game.Workspace.Testing.BrickColor = BrickColor.new("Black") -- Added here end
Let me know if that works, if not I will look into it further!
EDIT: Keep in mind the difference between =
and ==
. You would use =
to assign something to a variable. You would use ==
to compare.
More info on Conditional Operators/Statements: http://wiki.roblox.com/index.php?title=Conditional_statement
More info on BrickColor
:
http://wiki.roblox.com/index.php?title=BrickColor
For if
statements, you need to use ==
not =
. And on line 7(The anchored line), you used True
when it's supposed to be true
. Capitalization count's in Lua.
var1 = Instance.new("Part",workspace) var1.Position = Vector3.new(0,0,0) var1.Name = "Testing" wait(3) var1.BrickColor = BrickColor.new("Really red") var1.Transparency = 0.7 var1.Anchored = true if game.Workspace.Testing.Anchored == true then game.Workspace.Testing.BrickColor = BrickColor.new("Black") end