The GUI I'm trying to make is a GUI that shows online units (police, fire, EMS) and displays their status (available, busy, off-duty) through the color of a frame next to their name. I would like a script that changes the backgroundcolor of the frame when a player clicks one of three textbuttons that display different statuses. I don't have the script that will add the new GUI for every player who joins, but I don't care about that right now. I'm only testing with this one frame. I'm attempting to change the color of script.Parent.Parent.Units.Status1 script.Parent is a textbutton, Parent.Parent is a frame that holds the entirety of this GUI, Units has all the player's status, and Status1 is the frame whose color I need to change upon click of the textbutton.
Here's something that might help:
status1 = script.Parent.Parent.Units.Status1 status1.MouseButton1Click:connect(function() status.BackgroundColor3 = Color3.new(0,170,0) -- This would change it to green. wait(0.2) --How much time until the color changes back status.BackgroundColor3 = Color3.new(0,0,0) -- Insert your color here. end)