Camoy
|
  |
| Joined: 21 May 2009 |
| Total Posts: 6207 |
|
|
| 11 Oct 2009 05:38 PM |
| How do I make it so that if script.Parent.Oc# which is an NumberValue, if it is equal to 1, or 2 or 3 or 4 or 5, that for each corresponding number has a value 1 = Blah, 2 = Agh ect... Instead of doing If and then lots of elseif's, is there a smarter way? |
|
|
| Report Abuse |
|
|
|
| 11 Oct 2009 05:40 PM |
Values = { 1 = "Blah", 2 = "Argh", 3 = "etc" } X = Values[script.Parent.Oc.Value] |
|
|
| Report Abuse |
|
|
Camoy
|
  |
| Joined: 21 May 2009 |
| Total Posts: 6207 |
|
| |
|
|
| 11 Oct 2009 06:27 PM |
Values = {"Argh","Blah","Etc"}
X = Values[script.Parent.Oc.Value] |
|
|
| Report Abuse |
|
|
Camoy
|
  |
| Joined: 21 May 2009 |
| Total Posts: 6207 |
|
|
| 11 Oct 2009 07:15 PM |
-- This phailes..
Values = {"Meh","Blah","Etc"}
function onButton1Down()
x = Values[script.Parent.Parent.OcNum.Value]
print(OcNum.Value)
game.Workspace.JobCheck.Value = x
script.Parent.Parent.Visible = false
end
script.Parent.MouseButton1Down:connect(onButton1Down) |
|
|
| Report Abuse |
|
|
|
| 11 Oct 2009 08:54 PM |
First of all, output please? Second, use:
script.Parent.MouseButton1Click:connect(onButton1Down)
for the last line. |
|
|
| Report Abuse |
|
|
| |
|