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

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

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)

5 comments

0

So it sure be like when you click it check for lime green then runs the code down below that.

0

Try using "BrickColor.new(1020)"

0

You mans a genuis

0

One Question how would i loop this untill it is that color?

1 answer

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

2 comments

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.

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

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