generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Fail repeat

Previous Thread :: Next Thread 
LX7 is not online. 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 is not online. 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
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
19 Jul 2011 09:37 AM
repeat wait(0.02) b[i]:Remove() until #b == 0
Report Abuse
LX7 is not online. 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
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
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 is not online. 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 is not online. 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 is not online. 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
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
19 Jul 2011 09:48 AM
You're indexing t as nil. Don't do that.
Report Abuse
LX7 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. alexmach1
Joined: 02 May 2008
Total Posts: 1977
19 Jul 2011 09:55 AM
_ is not an applicable value.
Report Abuse
LX7 is not online. 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 is not online. 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 is not online. alexmach1
Joined: 02 May 2008
Total Posts: 1977
19 Jul 2011 09:56 AM
hang on, lemme test that theory.
Report Abuse
LX7 is not online. LX7
Joined: 19 Apr 2011
Total Posts: 1533
19 Jul 2011 09:57 AM
WOOT! IT WORKS
Report Abuse
alexmach1 is not online. 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 is not online. 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 is not online. alexmach1
Joined: 02 May 2008
Total Posts: 1977
19 Jul 2011 09:59 AM
late post much XD
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image