|
| 10 Jun 2014 12:26 AM |
What would the script be to be where when you step on a brick, it resets workspace and leaderboards. I have this but it isn't working:
function onTouch(part) msg = Instance.new("Message") msg.Parent = game.Workspace msg.Text = "The Chaos have won!" wait(3) local f = game.Players:children() for i = 1, #f do f[i].Character.Torso:remove() wait(0.1) local pts = game.Players:children() for i = 1, #pts do pts[i].leaderstats.KOs.Value = 0 pts[i].leaderstats.deaths.Value = 0 wait(0.1) local remove = game.Workspace:GetChildren() for i = 1, #remove do if remove[i].className == "Part" then remove[i]:remove() wait(1) msg.Text = "Game has reset" wait(3) msg:remove() end end end end end
|
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Jun 2014 04:07 AM |
| local pts = game.Players:GetPlayers() |
|
|
| Report Abuse |
|
|
|
| 10 Jun 2014 01:15 PM |
| local pts = game.Players:GetPlayers() would go at the beginning? |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Jun 2014 04:31 PM |
It replaces this: local pts = game.Players:children() |
|
|
| Report Abuse |
|
|
|
| 10 Jun 2014 09:14 PM |
| I did it but it still doesn't work |
|
|
| Report Abuse |
|
|
m27frogy
|
  |
| Joined: 26 Mar 2009 |
| Total Posts: 4427 |
|
|
| 10 Jun 2014 09:16 PM |
| There's this fancy thing called Output, incredibly useful sometimes. |
|
|
| Report Abuse |
|
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
|
| 10 Jun 2014 09:16 PM |
function onTouch(part) msg = Instance.new("Message") msg.Parent = game.Workspace msg.Text = "The Chaos have won!" wait(3) local f = game.Players:GetChildren() for i = 1, #f do f[i].Character.Torso:remove() wait(0.1) local pts = game.Players:GetChildren() for i = 1, #pts do pts[i].leaderstats.KOs.Value = 0 pts[i].leaderstats.deaths.Value = 0 wait(0.1) local remove = game.Workspace:GetChildren() for i = 1, #remove do if remove[i].className == "Part" then remove[i]:remove() wait(1) msg.Text = "Game has reset" wait(3) msg:remove() end end end end end script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
|
| 10 Jun 2014 09:21 PM |
@m27frogy Satan's waiting for you. |
|
|
| Report Abuse |
|
|