Airstruct
|
  |
| Joined: 13 Oct 2016 |
| Total Posts: 73 |
|
|
| 19 Nov 2017 06:52 PM |
I have an IntValue labeled as (Period), the IntValue is controlled by 5 buttons (for the quarters) that control the value of them (when click 1st, it changes to 1, when click 2nd, it changes to 2...when click OT, it changed to 5).
I need a script that would change the script's parent (text) to 1st when the value of the IntValue would be 1, and so on up until OT when the value of the IntValue would be 5.
How would I do that? |
|
|
| Report Abuse |
|
Voxxie
|
  |
| Joined: 27 Aug 2006 |
| Total Posts: 325 |
|
|
| 19 Nov 2017 06:54 PM |
I answered this in your other post :^)
local quarter = script.Parent.Quarter; local periodVal = workspace:WaitForChild("GameValues").Period;
periodVal.Changed:Connect(function() if periodVal.Value == 1 then quarter.Text = "1st"; elseif periodVal.Value == 2 then quarter.Text = "2nd"; -- etc etc etc end);
-- Or you can use the method below
local quarter = script.Parent.Quarter; local periodVal = workspace:WaitForChild("GameValues").Period; periods = {"1st", "2nd", "3rd", "4th", "OT"};
periodVal.Changed:Connect(function() quarter.Text = periods[periodVal.Value]; end); |
|
|
| Report Abuse |
|