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: Game Reset on Touch?

Previous Thread :: Next Thread 
avawhat231 is not online. avawhat231
Joined: 25 Apr 2008
Total Posts: 826
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
avawhat231 is not online. avawhat231
Joined: 25 Apr 2008
Total Posts: 826
10 Jun 2014 03:56 AM
Bump
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
10 Jun 2014 04:07 AM
local pts = game.Players:GetPlayers()
Report Abuse
avawhat231 is not online. avawhat231
Joined: 25 Apr 2008
Total Posts: 826
10 Jun 2014 01:15 PM
local pts = game.Players:GetPlayers() would go at the beginning?
Report Abuse
avawhat231 is not online. avawhat231
Joined: 25 Apr 2008
Total Posts: 826
10 Jun 2014 01:57 PM
It didn't work
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
10 Jun 2014 04:31 PM
It replaces this:
local pts = game.Players:children()
Report Abuse
avawhat231 is not online. avawhat231
Joined: 25 Apr 2008
Total Posts: 826
10 Jun 2014 09:14 PM
I did it but it still doesn't work
Report Abuse
m27frogy is not online. 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 is not online. 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
avawhat231 is not online. avawhat231
Joined: 25 Apr 2008
Total Posts: 826
10 Jun 2014 09:21 PM
@m27frogy
Satan's waiting for you.
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