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

Made a script so that if the brick ='d a certain color the size would change, what's wrong?

Asked by 9 years ago
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
wait(3)
var1.Transparency = 0.7
var1.Anchored = true
if game.Workspace.Testing.Anchored == true then -- == means to compare "check if something is equal to something", = means is equal to --
    game.Workspace.Testing.BrickColor = BrickColor.new("Black")
end
wait(3)
var1.BrickColor = BrickColor.new("Carnation pink")
wait(3)
if game.Workspace.Testing.BrickColor == ("Carnation pink") then
    game.Workspace.Testing.Size = Vector3.new(20,20,20)
end

1 answer

Log in to vote
0
Answered by 9 years ago

in line 16, you were comparing the brick's color to the string "Carnation pink". These are two different values, so just compare the color of the brick to the color "Carnation pink" instead of the string.

Additionally, you can substitute your references to the brick at the bottom with "var1"

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
wait(3)
var1.Transparency = 0.7
var1.Anchored = true
if var1.Anchored == true then -- == means to compare "check if something is equal to something", = means is equal to --
    var1.BrickColor = BrickColor.new("Black")
end
wait(3)
var1.BrickColor = BrickColor.new("Carnation pink")
wait(3)
if var1.BrickColor == BrickColor.new("Carnation pink") then --must compare brick color with brick color
    var1.Size = Vector3.new(20,20,20)
end
0
What would you replace line 16 with? LogicIntel 35 — 9y
0
if var1.BrickColor == BrickColor.new("Carnation pink") then DeveloperSolo 370 — 9y
0
I fixed the script for you, you can compare the new one to the old one to see what I edited. aquathorn321 858 — 9y
Ad

Answer this question