#Button script isn't working

12 messages · Page 1 of 1 (latest)

hexed verge
#

My button script (which what is supposed to happen, when you press it when its red it turns camo green, when you press it when it's camo it turns red) if script.Parent.Parent.BrickColor == ("Really Red") then
script.Parent.MouseClick:Connect(function ()

        script.Parent.Parent.BrickColor = BrickColor.new("Camo")
end)

elseif script.Parent.Parent.BrickColor == ("Camo") then
script.Parent.MouseClick:Connect(function ()

    script.Parent.Parent.BrickColor = BrickColor.new("Really Red")
end)

end

exotic dock
#
script.Parent.MouseClick:Connect(function () 
if script.Parent.Parent.BrickColor == ("Really Red") then
 script.Parent.Parent.BrickColor = BrickColor.new("Camo")
 elseif script.Parent.Parent.BrickColor == ("Camo") then
        script.Parent.Parent.BrickColor = BrickColor.new("Really Red")
end
    end)

#

use this

#

instead of what

#

you did

hexed verge
#

i did this

#

i put the function inside the if

exotic dock
#

thats

#

Wrong!

#

Just copy my script