|
| 06 Feb 2014 07:37 PM |
how do I call a function, I want a loop to play and have the function outside of it, but it wont work no matter how I try it
|
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 07:46 PM |
| please, I wrote dropLava() and the function Im trying to call is "function dropLava()" |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
shawnyg
|
  |
| Joined: 21 Apr 2011 |
| Total Posts: 1428 |
|
|
| 06 Feb 2014 07:47 PM |
Creating a function - function FuncName() while true do end
Calling a function -
FuncName()
~The G |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 07:50 PM |
I did exactly that... lava = script.Parent.Lava:getChildren() while true do dropLava() wait(.2) end
function dropLava() i = math.random(1, #lava) c = Lava[i]:clone() c.Parent = script.Parent.Clones c.Position = lava[i] - Vector3.new(0,1.2,0) wait(3) c:destroy() end
Error "attempt to call global 'dropLava'(a nil value)" |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 06 Feb 2014 07:52 PM |
| -.- it's because it's not created when you called it, and it never will since an infinite loop will run. |
|
|
| Report Abuse |
|
|
| |
|
|
| 06 Feb 2014 07:55 PM |
is there any way to make it drop one every .2 seconds rather than every 1.2? it adds those in the loop and the function
|
|
|
| Report Abuse |
|
|