vacharya
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 511 |
|
|
| 30 Jan 2015 08:06 AM |
On how many elseif part.Value == "Cats" then can be used in a loop running through all the parts? I have about 9 elseif's and it just doesnt reach the 8th one.. Nothing on the output, I've checked and double checked that the value Cats exists and even put a print("Reach") to no avail.
Any help would be appreciated :D |
|
|
| Report Abuse |
|
|
|
| 30 Jan 2015 08:13 AM |
| If it's not working, try putting a print there and marks everywhere when you run to an event problem. Though, I do not think there is considering I used 12 elseifs once. |
|
|
| Report Abuse |
|
|
vacharya
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 511 |
|
|
| 30 Jan 2015 08:52 AM |
| I did, it just never reaches there.. |
|
|
| Report Abuse |
|
|
| |
|
vacharya
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 511 |
|
|
| 30 Jan 2015 02:00 PM |
well the code is VERY long but here it what it does
v.MouseButton1Down:connect(function() if v.Name == "Pig" then print("Pig") elseif v.Name == "Dog" then print("Dog") elseif v.Name == "John" then print("John") elseif v.Name == "Wolf" then print("Wolf") elseif v.Name == "Pi" then print("pi") elseif v.Name == "Name" then print("Name") elseif v.Name == "Join" then print("Join") elseif v.Name == "Cat" then --This is where it stops, nothing on the output.. --The hypothetical "Cat" does exist --Could it be because of too many elseif's? IS there a limit on elseif's? --NOTHING from this point on runs.. (No output errors) print("Cat")
end end)
:) |
|
|
| Report Abuse |
|
|
|
| 30 Jan 2015 02:02 PM |
There is no limit on elseif.
Are you sure it's called Cat? That seems like the only possible problem here, a type or something. |
|
|
| Report Abuse |
|
|
|
| 30 Jan 2015 02:04 PM |
try
v.MouseButton1Down:connect(function() print(v.Name) if v.Name == "Pig" then print("Pig") elseif v.Name == "Dog" then print("Dog") elseif v.Name == "John" then print("John") elseif v.Name == "Wolf" then print("Wolf") elseif v.Name == "Pi" then print("pi") elseif v.Name == "Name" then print("Name") elseif v.Name == "Join" then print("Join") elseif v.Name == "Cat" then --This is where it stops, nothing on the output.. --The hypothetical "Cat" does exist --Could it be because of too many elseif's? IS there a limit on elseif's? --NOTHING from this point on runs.. (No output errors) print("Cat")
end end)
And see what prints. |
|
|
| Report Abuse |
|
|
Roblok1
|
  |
| Joined: 27 Jul 2011 |
| Total Posts: 2019 |
|
|
| 30 Jan 2015 02:07 PM |
| just use a recursive function. |
|
|
| Report Abuse |
|
|
|
| 30 Jan 2015 02:22 PM |
| @roblo that has nothing to do with what he's trying to do. |
|
|
| Report Abuse |
|
|