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

Menu Change Color not Working? Don't know problem.

Asked by 10 years ago

I Made a Menu, the menu is blue. However, I want to match the menu to the status. The status colors change depending on if it's Loading Map, Waiting for Players, the match is in progress, and during Intermission. However it only matches with Waiting for Players and Loading Map. This script is suppose to make it Red during Match and Orange during Intermission but it stays Blue, I've tried for an hour and can't figure out the problem.

function updatestatus()
 if timertag.Value < 0  then
  statustitle.Text = statustag.Value
 else
  statustitle.Text = statustag.Value .. "  (" .. secondstotimer(timertag.Value) .. ")"
 end
 if statustag.Value == "Intermission" then
  statustitle.BackgroundColor3 = Color3.new(255/255, 170/255, 0/255)
  MenuColor = Color3.new(255/255, 170/255, 0/255)
 elseif statustag.Value == "Match" then
  statustitle.BackgroundColor3 = Color3.new(170/255, 0/255, 0/255)
  MenuColor = Color3.new(170/255, 0/255, 0/255)
 elseif statustag.Value == "Loading Map" or statustag.Value == "Waiting for Players" then
  statustitle.BackgroundColor3 = Color3.new(0/255, 170/255, 255/255)
  MenuColor = Color3.new(0/255, 170/255, 255/255)
 end
end

1 answer

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
10 years ago

Your current script has no errors, but make sure you're calling the 'updatestatus' function in either a loop or, preferably, a Changed Event.

Ad

Answer this question