Hi,
In my script, there are red underlines under certain parts of my code.
Why is that? How can I fix this script so it has no errors? What am I doing wrong?
(By the way, this is a local script.)
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid")then
if game.Workspace.FactoryLasers.LaserButton.BrickColor = (255, 0, 0) then
then
game.Workspace.NoLazerBadge.BadgeAwarderScript.Disabled = false
end
end)
(And also, the brick color’s name is “Really red”.)
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid")then
if game.Workspace.FactoryLasers.LaserButton.BrickColor == "Really red" then
game.Workspace.NoLazerBadge.BadgeAwarderScript.Disabled = false
end
end
end)
The brick color isn’t a vector3, the .Color is. So if the color is “Really red” then do __. You also didn’t put 2 equal signs.
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if game.Workspace.FactoryLasers.LaserButton.BrickColor == BrickColor.new("Really red") then
game.Workspace.NoLazerBadge.BadgeAwarderScript.Disabled = false
end
end
end)
But wouldn’t the “BrickColor.new” part not fit? Like I just want the function to work if that color is red. Wouldn’t the script then turn that part red since from the “BrickColor.new”?