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

What is wrong with this code here? try to check if brickcolor is equal to lime green.

Asked by 4 years ago
script.Parent.ClickDetector.MouseClick:Connect(function()

if(game.Workspace.Light_Stat_1.BrickColor == BrickColor.new("Lime green"))then

    print("hi2")

    local Lift1 = Instance.new("Part")

    Lift1.Parent = game.Workspace

    Lift1.Shape = "Cylinder"

    Lift1.Anchored = true

    Lift1.CanCollide = true

    Lift1.Size = Vector3.new(7.75, 12.06, 10.04)

    Lift1.Position = Vector3.new(-89.933, 3.925, 215.561)

    Lift1.Name = "Lift1"

    end

    end)
0
So it sure be like when you click it check for lime green then runs the code down below that. vortex767 20 — 4y
0
Try using "BrickColor.new(1020)" BashGuy10 384 — 4y
0
You mans a genuis vortex767 20 — 4y
0
One Question how would i loop this untill it is that color? vortex767 20 — 4y

1 answer

Log in to vote
1
Answered by
karlo_tr10 1233 Moderation Voter
4 years ago

Your BrickColor isn't Lime green because I just tested with part and works for me:



if game.Workspace.Part.BrickColor == BrickColor.new("Fossil") then print("Test") end -- Prints Test
0
This is the only answer that makes sense. His conditional statement is just fine. It may not be visually appealing but the syntax is right. Unhumanly 152 — 4y
0
Ya but it is a button i made so when i press it it check if it is lime green then mades a part but it starts as really red vortex767 20 — 4y
Ad

Answer this question