|
| 03 Dec 2014 12:11 PM |
floaty = script.Parent
while true do function move()
for x = 1,19 do floaty.Position = floaty.Position + Vector3.new(-1,0,0) end end
floaty.ClickDetector.MouseClick:connect(move)
|
|
|
| Report Abuse |
|
|
adeep
|
  |
| Joined: 06 Feb 2010 |
| Total Posts: 274 |
|
|
| 03 Dec 2014 12:13 PM |
Why do you have a while true do in their?
Code-
floaty = script.Parent
function move()
for x = 1,19 do floaty.Position = floaty.Position + Vector3.new(-1,0,0)
end
floaty.ClickDetector.MouseClick:connect(move) |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2014 12:13 PM |
| it says expected 'end' to close to 'while' at line 3 |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2014 12:13 PM |
| i'd like it to repeat the function for 19 studs. |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2014 12:14 PM |
You are missing an end. But don't declare functions in a loop, that is nonsense. |
|
|
| Report Abuse |
|
|
adeep
|
  |
| Joined: 06 Feb 2010 |
| Total Posts: 274 |
|
|
| 03 Dec 2014 12:14 PM |
Sorry forgot an end
Code-
floaty = script.Parent
function move()
for x = 1,19 do floaty.Position = floaty.Position + Vector3.new(-1,0,0)
end end
floaty.ClickDetector.MouseClick:connect(move) |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 03 Dec 2014 12:15 PM |
while true do function move()
OH NO NO NO STOP WH4T YOU 4R3 DO1NG G3T TH4T LOOP OUT OF TH3R3 R1GHT NOW |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2014 12:15 PM |
How about this?;
floaty = script.Parent
function move()
while true do for x = 1,19 do floaty.Position = floaty.Position + Vector3.new(-1,0,0)
end end
floaty.ClickDetector.MouseClick:connect(move)
|
|
|
| Report Abuse |
|
|
|
| 03 Dec 2014 12:16 PM |
| Oh, also, put the connection before the infinite loop. |
|
|
| Report Abuse |
|
|
adeep
|
  |
| Joined: 06 Feb 2010 |
| Total Posts: 274 |
|
| |
|
adeep
|
  |
| Joined: 06 Feb 2010 |
| Total Posts: 274 |
|
|
| 03 Dec 2014 12:23 PM |
You going to crash you studio XD, add some sort waiting function
Bad-
floaty = script.Parent
function move()
while true do for x = 1,19 do floaty.Position = floaty.Position + Vector3.new(-1,0,0)
end end
floaty.ClickDetector.MouseClick:connect(move)
Ex. Code-
floaty = script.Parent
function move()
while true do for x = 1,19 do floaty.Position = floaty.Position + Vector3.new(-1,0,0) wait() -- this wait 1/30 of a second.
end end end
floaty.ClickDetector.MouseClick:connect(move) |
|
|
| Report Abuse |
|
|