LX7
|
  |
| Joined: 19 Apr 2011 |
| Total Posts: 1533 |
|
|
| 19 Jul 2011 09:35 AM |
if (game.PlaceId ~= 1) then a = game:getChildren()
for _,v in pairs (g) do b = v:getChildren()
for i = 1,#b do
repeat wait(0.02) b[i]:remove until #b == 0
end end end
Workspace.Script:16: function arguments expected near 'until'
Trying to make a hidden code, the hidden part is somewhere else. |
|
|
| Report Abuse |
|
|
alexmach1
|
  |
| Joined: 02 May 2008 |
| Total Posts: 1977 |
|
|
| 19 Jul 2011 09:36 AM |
repeat wait(0.02) b[i]:remove() until #b == 0 |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2011 09:37 AM |
repeat wait(0.02) b[i]:Remove() until #b == 0
|
|
|
| Report Abuse |
|
|
LX7
|
  |
| Joined: 19 Apr 2011 |
| Total Posts: 1533 |
|
|
| 19 Jul 2011 09:41 AM |
FAIL, this is a fail
t = nil a = math.random(1,3) if a == 1 then local t = Instance.new("VelocityMotor") elseif a == 2 then local t = Instance.new("Timer") elseif a == 3 then local t = Instance.new("Geometry") end location = game.Workspace.Script t.Parent = location
Workspace.Sleeper:12: attempt to index global 't' (a nil value) |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2011 09:41 AM |
t = "" a = math.random(1,3) if a == 1 then local t = Instance.new("VelocityMotor") elseif a == 2 then local t = Instance.new("Timer") elseif a == 3 then local t = Instance.new("Geometry") end location = game.Workspace.Script t.Parent = location
|
|
|
| Report Abuse |
|
|
LX7
|
  |
| Joined: 19 Apr 2011 |
| Total Posts: 1533 |
|
|
| 19 Jul 2011 09:44 AM |
| Workspace.Sleeper:12: attempt to index global 't' (a string value) |
|
|
| Report Abuse |
|
|
alexmach1
|
  |
| Joined: 02 May 2008 |
| Total Posts: 1977 |
|
|
| 19 Jul 2011 09:45 AM |
repeat --wait() a = math.random(1,3) if a == 1 then local t = Instance.new("VelocityMotor") elseif a == 2 then local t = Instance.new("Timer") elseif a == 3 then local t = Instance.new("Geometry") end until t~=nil location = game.Workspace.Script t.Parent = location
that may work or it may crash XD |
|
|
| Report Abuse |
|
|
LX7
|
  |
| Joined: 19 Apr 2011 |
| Total Posts: 1533 |
|
|
| 19 Jul 2011 09:48 AM |
t = nil repeat wait(0.01) a = math.random(1,3) if a == 1 then local t = Instance.new("VelocityMotor") elseif a == 2 then local t = Instance.new("Timer") elseif a == 3 then local t = Instance.new("Geometry") end until t~= nil location = game.Workspace.Script
No output, never stops. :P |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2011 09:48 AM |
| You're indexing t as nil. Don't do that. |
|
|
| Report Abuse |
|
|
LX7
|
  |
| Joined: 19 Apr 2011 |
| Total Posts: 1533 |
|
|
| 19 Jul 2011 09:49 AM |
| Turned it into a string and it does nothing. |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 19 Jul 2011 09:51 AM |
local t = nil a = math.random(1,3) if a == 1 then t = Instance.new("VelocityMotor") elseif a == 2 then t = Instance.new("Timer") elseif a == 3 then t = Instance.new("Geometry") end
You're redefining a new t variable, local to the if statement, so it goes out of scope (t reverts back to its original nil or "" value).
Try mine. |
|
|
| Report Abuse |
|
|
LX7
|
  |
| Joined: 19 Apr 2011 |
| Total Posts: 1533 |
|
|
| 19 Jul 2011 09:53 AM |
Ok, swm's works but now the bottom part of script breaks.
if (game.PlaceId ~= 1) then a = game:getChildren()
for _,v in pairs (g) do b = v:getChildren()
for i = 1,#b do
repeat wait(0.02) b[i]:remove() until #b == 0
end end end
Workspace.Sleeper:18: bad argument #1 to 'pairs' (table expected, got nil) |
|
|
| Report Abuse |
|
|
LX7
|
  |
| Joined: 19 Apr 2011 |
| Total Posts: 1533 |
|
|
| 19 Jul 2011 09:53 AM |
| -18 l for _,v in pairs (g) do |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 19 Jul 2011 09:55 AM |
a = game:getChildren()
for _,v in pairs (g) do
You defined "a"... Where did g come from? |
|
|
| Report Abuse |
|
|
alexmach1
|
  |
| Joined: 02 May 2008 |
| Total Posts: 1977 |
|
|
| 19 Jul 2011 09:55 AM |
| _ is not an applicable value. |
|
|
| Report Abuse |
|
|
LX7
|
  |
| Joined: 19 Apr 2011 |
| Total Posts: 1533 |
|
|
| 19 Jul 2011 09:56 AM |
| Oh fail, I renamed 'g' with 'a'. I'm stupid :P |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 19 Jul 2011 09:56 AM |
@alex
_ is a usable variable name. All he's (trying) to do is name a variable _. |
|
|
| Report Abuse |
|
|
alexmach1
|
  |
| Joined: 02 May 2008 |
| Total Posts: 1977 |
|
|
| 19 Jul 2011 09:56 AM |
| hang on, lemme test that theory. |
|
|
| Report Abuse |
|
|
LX7
|
  |
| Joined: 19 Apr 2011 |
| Total Posts: 1533 |
|
| |
|
alexmach1
|
  |
| Joined: 02 May 2008 |
| Total Posts: 1977 |
|
|
| 19 Jul 2011 09:57 AM |
| lol, its just that ive never used _ before. it works |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 19 Jul 2011 09:59 AM |
| It isn't a theory... I have personally used _ as a variable name before, basicly _ is used when you'll never use a variable but have to define it because the function returns multiple results (like the pairs() function) and the results return in order. |
|
|
| Report Abuse |
|
|
alexmach1
|
  |
| Joined: 02 May 2008 |
| Total Posts: 1977 |
|
| |
|