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

Why is my If statment not working properly? (Ansvered)

Asked by 5 years ago
Edited 5 years ago

Why is it not printing i didn't misspell anything, the part is that color like i don't get it can someone explain what i did wrong like this sounds soo logic but for some reason it's not.

if  workspace.Part.BrickColor == "Medium stone grey then" then
    print("Yes it's Grey") 
end

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago
  1. You added an extra "then" inside the BrickColor name

  2. BrickColor can only be called by adding "BrickColor.new" to the string

Revised:

if workspace.Part.BrickColor == BrickColor.new("Medium stone grey") then
    print("Yes it's Gray")
end
0
Thanks! Freddan2006YT 88 — 5y
Ad

Answer this question