|
| 10 Nov 2012 03:31 PM |
Why does this crash my game? I have listed the two scripts that are in my game.
***Script 1:***
ChatNew = script:FindFirstChild("0").Value Chat1 = script:FindFirstChild("1").Value Chat2 = script:FindFirstChild("2").Value Chat3 = script:FindFirstChild("3").Value Chat4 = script:FindFirstChild("4").Value Chat5 = script:FindFirstChild("5").Value
game.Workspace.Chat.System.Changed:connect(function() ChatNew = "System: "..script.System.Value wait() if Chat1 == "" then Chat1 = ChatNew ChatNew = "" elseif Chat1 ~= "" and Chat2 == "" then Chat2 = ChatNew ChatNew = "" elseif Chat1 ~= "" and Chat2 ~= "" and Chat3 == "" then Chat3 = ChatNew ChatNew = "" elseif Chat1 ~= "" and Chat2 ~= "" and Chat3 ~= "" and Chat4 == "" then Chat4 = ChatNew ChatNew = "" elseif Chat1 ~= "" and Chat2 ~= "" and Chat3 ~= "" and Chat4 ~= "" and Chat5 == "" then Chat5 = ChatNew ChatNew = "" elseif Chat1 ~= "" and Chat2 ~= "" and Chat3 ~= "" and Chat4 ~= "" and Chat5 ~= "" then Chat1 = Chat2 Chat2 = Chat3 Chat3 = Chat4 Chat4 = Chat5 Chat5 = ChatNew ChatNew = "" end local c = game.Players:GetChildren() for i = 1, #c do wait() c[i].PlayerGui.Chat.Small.Window:FindFirstChild("1").Text = Chat1 c[i].PlayerGui.Chat.Small.Window:FindFirstChild("2").Text = Chat2 c[i].PlayerGui.Chat.Small.Window:FindFirstChild("3").Text = Chat3 c[i].PlayerGui.Chat.Small.Window:FindFirstChild("4").Text = Chat4 c[i].PlayerGui.Chat.Small.Window:FindFirstChild("5").Text = Chat5 end end)
***Script 2:***
while true do for i = 1, 3 do wait(1) text = "Game starting in "..i.." seconds." game.Workspace.Chat.System.Value = text end end |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2012 03:32 PM |
| Script #2 crashes your game. |
|
|
| Report Abuse |
|
|
| |
|
Monkey727
|
  |
| Joined: 12 Jan 2009 |
| Total Posts: 969 |
|
|
| 10 Nov 2012 03:40 PM |
You need a wait inside the while loop, (But outside for loop too).
while true do for i = 1, 3 do wait(1) text = "Game starting in "..i.." seconds." game.Workspace.Chat.System.Value = text end wait() end |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2012 03:49 PM |
| I changed the second script to what you said to use, but it still crashes. |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2012 04:16 PM |
| Anybody know why its not working? That does not seem to be the problem. |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2012 04:30 PM |
Tried changing the second script to just this, still crashed.
for i = 100, 0, -1 do wait(1) text = "Game starting in "..i.." seconds." game.Workspace.Chat.System.Value = text end |
|
|
| Report Abuse |
|
|