|
| 30 May 2013 07:24 PM |
-- My studio keeps crashing when i press play, it's doing this with all of my places i -- make, so i need someone to judge this for me please.
e = script.Parent.AIPlace.Value while true do wait() d = math.Random(1,4) script.Parent.AIPlace.Value.Value = d if e > a then -- What ever else end end
--[[
Its suppose to choose a random number between one and four, then it records the random number in it's stringvalue, next it compares it's Value to a's Value, its suppose to find if its bigger, and if it is then bla bla bla. |
|
|
| Report Abuse |
|
|
| |
|
|
| 30 May 2013 07:30 PM |
>> math.Random(1,4)
math.random(1,4)
caps are a b |
|
|
| Report Abuse |
|
|
Desperian
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 30 May 2013 07:31 PM |
1) With your 'e' variable it'll just become the value indicated when the script first runs, and will not change from that even if the value is changed. 2) You've not defined 'a' anywhere. 3) You should store the data in the relevant value type. So, for a number, you should use a 'NumberValue'. It makes more logical sense. 4) What Ale said. |
|
|
| Report Abuse |
|
|
|
| 30 May 2013 07:35 PM |
I didn't list all the "whatever = this"'s yet btw.
|
|
|
| Report Abuse |
|
|
|
| 30 May 2013 07:44 PM |
e = script.Parent.Value a = script.Parent.Parent.Parent:findFirstChild("Adrianople").Torso.AIPlace.Value
while true do wait() d = math.random(1,4) e.Value = d if e.Parent.Parent.BrickColor == a.Parent.Parent.BrickColor then end if not e.Parent.Parent.BrickColor == a.Parent.Parent.BrickColor then if e > a then print("Testing started!") -- Just to check if the script works properly b = e - a -- OHIADER e.Value = b a.Parent.Parent.BrickColor = Color3.new("e.Parent.Parent.BrickColor") print("Testing ended!") -- Just to check if the script works properly wait(10) end end end)
--[[
The line next to OHIADER is suppose to subtract e and a's Number Values, then change e's Value to b, which is the answer from the subtraction (I doubt i did it right).
It's also checking if the BrickColor is the same or not, and if it is, it does not continue with the process but should rather end until next turn.
This is a small bit for a Territory Conquest, only its AI's against AI's. |
|
|
| Report Abuse |
|
|