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

Im tyring to make a pvp on / off button, how do i change the guis color?

Asked by 4 years ago

here is my script

local button = script.Parent
local color = button.BackgroundColor3
color = Color3.new(255,0,0)

script.Parent.MouseButton1Click:Connect(function ()
    if color == Color3.new(255,0,0) then
        color = Color3.new(4,255,0)
    end
    if color == Color3.new(4,255,0) then
        color = Color3.new(255,0,0)
    end
end)

0
Change each Color3.new to Color3.fromRGB MrZolten 0 — 4y
0
it didnt work Ninjalord1003 2 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

You need to add a wait in-between the color script because it runs so fast you dont get to see the change

local button = script.Parent
local color = button.BackroundColor3
color = Color3.new(255, 0, 0)

script.Parent.MouseClick:Connect(function()
    if color == Color3.new(255, 0, 0) then
    wait(.5)
    color = Color3.new(4, 255, 0)
    end
    if color == Color3.new(255, 0, 0) then
        wait(.5)
        color = Color3.new(4, 255, 0)
    end
end)
0
it still not work Ninjalord1003 2 — 4y
0
that's weird maxpax2009 340 — 4y
0
IS THERE A CERTIAN PLACE I SHOULD BE PUTTING IT sry caps Ninjalord1003 2 — 4y
Ad

Answer this question