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

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

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)

2 comments

0

Change each Color3.new to Color3.fromRGB

0

it didnt work

1 answer

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)

3 comments

0

it still not work

0

that's weird

0

IS THERE A CERTIAN PLACE I SHOULD BE PUTTING IT sry caps

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