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: Errors but still runs.

Previous Thread :: Next Thread 
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
18 Feb 2012 11:08 PM
This script is really inefficient...Anyway, I got this script.
while wait() do
if game.Workspace:FindFirstChild("Round")~=nil or game.Workspace:FindFirstChild("Round")==nil then
repeat wait() until game.Workspace:FindFirstChild("Round")game.Workspace.Round.Changed:connect(function(change)
repeat wait() until game.Workspace:FindFirstChild("Round")
repeat wait() until game.Workspace.Round.Text == "You have 3 seconds until round is over."
for i,v in pairs(_G.myTable2) do
game.Players[v].Character.Torso.CFrame = CFrame.new(-59, 1, 190)
if game.Players[v].Backpack:FindFirstChild("DanceTool")~=nil then
game.Players[v].Backpack.DanceTool:Destroy()
end
if game.Players[v].Character:FindFirstChild("DanceTool")~=nil then
game.Players[v].Character.DanceTool:Destroy()
end
end
end)
end
end

First round it perfectly works, no errors. Second round output saysRound is not a valid member of Workspace. But it still runs. Should I be worried?

At the end of the round Round does go nil but it comes back 2 seconds later. Wouldthis still run?
Report Abuse
aboy5643 is not online. aboy5643
Joined: 08 Oct 2010
Total Posts: 5458
19 Feb 2012 12:00 AM
Does the output ever say "break"???

"Locked" - Sorcus
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
19 Feb 2012 12:05 AM
All the output says is Round is a valid member of Workspace. But thing is the hint(Round) comes back 2 seconds later so it still runs. Though, I'm just thinking will this error at some point?
Report Abuse
aboy5643 is not online. aboy5643
Joined: 08 Oct 2010
Total Posts: 5458
19 Feb 2012 12:06 AM
Can you point out the line that errors??

"Locked" - Sorcus
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
19 Feb 2012 12:09 AM
Line 6, second repeat.

repeat wait() until game.Workspace:FindFirstChild("Round")
Report Abuse
aboy5643 is not online. aboy5643
Joined: 08 Oct 2010
Total Posts: 5458
19 Feb 2012 12:12 AM
while wait() do
if game.Workspace:FindFirstChild("Round") then
game.Workspace.Round.Changed:connect(function(change)
repeat wait() until game.Workspace.Round.Text == "You have 3 seconds until round is over."
for i,v in pairs(_G.myTable2) do
game.Players[v].Character.Torso.CFrame = CFrame.new(-59, 1, 190)
if game.Players[v].Backpack:FindFirstChild("DanceTool")~=nil then
game.Players[v].Backpack.DanceTool:Destroy()
end
if game.Players[v].Character:FindFirstChild("DanceTool")~=nil then
game.Players[v].Character.DanceTool:Destroy()
end
end
end)
end
end

Try this. You had lots of useless stuff.

"Locked" - Sorcus
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
19 Feb 2012 12:14 AM
Don't use repeat..until loops. They're deprecated I've been told and from experience they just don't work like you'd expect.
Report Abuse
aboy5643 is not online. aboy5643
Joined: 08 Oct 2010
Total Posts: 5458
19 Feb 2012 12:16 AM
@adark

Since when?? They're perfectly legitimate and it's a standard Lua control structure.

"Locked" - Sorcus
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
19 Feb 2012 12:20 AM
Still errored but yet ran :l

Round is not a valid member of Workspace
00:17:38 - Script "Workspace.Disco.Mus", Line 4
00:17:38 - stack end


There were lots of errors just like this too.
Report Abuse
aboy5643 is not online. aboy5643
Joined: 08 Oct 2010
Total Posts: 5458
19 Feb 2012 12:21 AM
Which one is 4??

"Locked" - Sorcus
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
19 Feb 2012 12:22 AM
repeat wait() until game.Workspace.Round.Text == "You have 3 seconds until round is over."
Report Abuse
aboy5643 is not online. aboy5643
Joined: 08 Oct 2010
Total Posts: 5458
19 Feb 2012 12:25 AM
Hmmmmmmm... I'm not sure how well making an event connection once a frame works?? That may be part of the issue.

"Locked" - Sorcus
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
19 Feb 2012 12:27 AM
Should I add another wait or something to wait until it is not nil?
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
19 Feb 2012 12:21 PM
How about this. If this still runs in start server mode yet it errors, do you think it'll run in online mode?
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
19 Feb 2012 12:41 PM
Are myTable and myTable2 the ONLY POSSIBLE variable names you can come up with for tables???
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
19 Feb 2012 12:43 PM
For the last time, I won't do this again!!!!! I can't change it now because everything is set!!!! Jeez, Their just player names! I won't do it again! Now, can you answer my question?!?
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
20 Feb 2012 09:03 AM
Bawmp....
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
20 Feb 2012 10:00 AM
Can anyone answer me?
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
20 Feb 2012 05:10 PM
No one? Really?
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