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 » Scripters
Home Search
 

Game script - restart script

Previous Thread :: Next Thread 
Iliuminatis is not online. Iliuminatis
Joined: 30 Nov 2008
Total Posts: 1524
14 Nov 2015 04:49 PM
Okay, I have this game running script I've made:
______________________________________________

while true do


wait(3)
for i, v in pairs(game.Players:GetChildren()) do v.Character.Torso.CFrame = CFrame.new(Vector3.new(-132, 10, -84))
end
script.AdNet.Script.Disabled = true
game.Lighting.Door1:Clone().Parent = game.Workspace
game.Lighting.TimeOfDay = "11:00:00"
wait(1)
game.Lighting.TimeOfDay = "12:00:00"


local n = Instance.new("Hint")
n.Parent = game.Workspace
n.Text = "Enemy wave incoming!"
wait(5)
n:Remove()
game.Lighting.Z1:Clone().Parent = game.Workspace
game.Lighting.S1:Clone().Parent = game.Workspace
script.Sound1:play()
wait(120)
script.Sound1:Stop()
game.Workspace.S1:Remove()
game.Workspace.Z1:Remove()

wait(1)

end
_________________________________________________

I need the music to stop and S1 and Z1 to be removed when the Crystal in Workspace dies.

Crystal is Humanoid (game.Workspace.Crystal.Humanoid)
When Crystal's Health is 0, music stops, S1 and Z1 are removed from Workspace.
After 5 seconds ( wait(5) ) Crystal is regenerated and back to it's position, and the Game Script starts running from beginning.
The game script has to be basically reseted to it's start (the first line).
Report Abuse
Iliuminatis is not online. Iliuminatis
Joined: 30 Nov 2008
Total Posts: 1524
14 Nov 2015 05:12 PM
Any help??
Report Abuse
CWRA0444 is not online. CWRA0444
Joined: 14 Jan 2010
Total Posts: 6013
14 Nov 2015 05:18 PM
code
repeat wait() until workspace.Crystal.Humanoid.Health == 0
code

just a siggy in its natural habitat
Report Abuse
Iliuminatis is not online. Iliuminatis
Joined: 30 Nov 2008
Total Posts: 1524
14 Nov 2015 05:32 PM
Thanks, but I've found a solution just before your reply ^^
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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