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
|
  |
| Joined: 08 Oct 2010 |
| Total Posts: 5458 |
|
|
| 19 Feb 2012 12:00 AM |
Does the output ever say "break"???
"Locked" - Sorcus |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 08 Oct 2010 |
| Total Posts: 5458 |
|
|
| 19 Feb 2012 12:21 AM |
Which one is 4??
"Locked" - Sorcus |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|