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: Script not removing map.

Previous Thread :: Next Thread 
madiik is not online. madiik
Joined: 10 Feb 2009
Total Posts: 625
07 Dec 2012 06:56 AM
function reset()
for i = 15, 1, -1 do
print ("New game will start in "..i.." seconds")
wait (1)
end

Maps = {game.Lighting.WarTown, game.Lighting.FarLands}
NumMaps = 2 --Number of maps

RandomChoice = math.random(1, NumMaps)
CurrentMap = Maps[RandomChoice]
CurrentMap:clone().Parent = game.Workspace


wait(40)
for i,v in pairs(game.Players:GetPlayers()) do
if v.Character ~= nil then
if v.Character.Humanoid ~= nil then
v.Character.Humanoid.Health = 0
end
end
end

local Map = game.Workspace:findFirstChild("WarTown", "FarLands")
if map then
map:remove()
end

end

reset()

I got the round system working, But after that it won't complete the function really. It doesn't remove the map that i have? What's the problem.
Report Abuse
lombardo2 is not online. lombardo2
Joined: 30 Nov 2008
Total Posts: 1604
07 Dec 2012 07:00 AM
function reset()
for i = 15, 1, -1 do
print ("New game will start in "..i.." seconds")
wait (1)
end

Maps = {game.Lighting.WarTown, game.Lighting.FarLands}

RandomChoice = math.random(1, #Maps)
CurrentMap = Maps[RandomChoice]:Clone()
CurrentMap.Parent = Workspace


wait(40)
for i,v in pairs(game.Players:GetPlayers()) do
if v.Character ~= nil then
if v.Character.Humanoid ~= nil then
v.Character.Humanoid.Health = 0
end
end
end

CurrentMap:Destroy()

end

reset()
Report Abuse
madiik is not online. madiik
Joined: 10 Feb 2009
Total Posts: 625
07 Dec 2012 07:02 AM
Instead of making lots of lines i should use CurrentMap:Destroy()?
We'll im gonna test it. Then see if CS 1.6 Round system works for it. P.S i added wait(40) so I don't need to wait for like 5 minutes, I'm testing it, Later adding it to wait(300)
Report Abuse
madiik is not online. madiik
Joined: 10 Feb 2009
Total Posts: 625
07 Dec 2012 07:05 AM
Okay That is still a problem. I waited for 40 seconds and nothing happened.
Report Abuse
madiik is not online. madiik
Joined: 10 Feb 2009
Total Posts: 625
07 Dec 2012 07:08 AM
It broke mah script :(
Report Abuse
lombardo2 is not online. lombardo2
Joined: 30 Nov 2008
Total Posts: 1604
07 Dec 2012 07:12 AM
Lawl, then it's your script, I just stored the clone in CurrentMap so I can later destroy it.
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