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
 

Script Error?

Previous Thread :: Next Thread 
MMOfficial is not online. MMOfficial
Joined: 20 May 2013
Total Posts: 276
07 Jun 2013 11:15 PM
__________________________________________________________________
function spawnMap(gMode)
local mapName
mapLibrary = game.Lighting.Resources.Maps
if workspace:findFirstChild("Map") then
workspace:findFirstChild("Map"):Destroy()
end
if workspace.Ignore:findFirstChild("Flags") then
workspace.Ignore.Flags:Destroy()
Instance.new("Model",workspace.Ignore).Name = "Flags"
end
if gMode == "Elimination" then
repeat
map = mapLibrary.FFA:GetChildren()[math.random(1,#mapLibrary.FFA:GetChildren())]
until map ~= lastmap
lastmap = map
map = map:clone()
mapName = map.Name
gd.gameMap.Value = mapName
map.Name = "Map"
end
alert(gMode.." at "..mapName,Color3.new(0.3,0.8,0))
map.Parent = workspace
if map:findFirstChild("BlueFlag") then
map.BlueFlag.Parent = workspace.Ignore.Flags
end
if map:findFirstChild("RedFlag") then
map.RedFlag.Parent = workspace.Ignore.Flags
if players[x].Character.Humanoid.Health = 0 then
repeat
gtoolr:remove()
spectate:clone().Parent = player.Backpack
alert("A player died!!!",Color3.new(0,0.8,1))
end
gameMode = gd.gameMode
gameTime = gd.gameTime
gModes = {"Elimination"}
while true do
pcall(RidStuff)
gameMode.Value = gModes[math.random(1,#gModes)]
gameTime.Value = roundTime[gameMode.Value]
spawnMap(gameMode.Value)
repeat
wait(1)
gameTime.Value = gameTime.Value - 1
if gameTime.Value == 300 then
alert("5 minutes left!",Color3.new(0,0.8,1))
end
if gameTime.Value == 180 then
alert("3 minutes left!",Color3.new(0,0.8,1))
end
if gameTime.Value == 60 then
alert("1 minute left!",Color3.new(0,0.8,1))
end
if gameTime.Value == 30 then
alert("30 seconds left!",Color3.new(0,0.8,1))
end
if gameTime.Value == 5 then
alert("Round ending...!",Color3.new(0,0.8,1))
end
until gameTime.Value <= 0
gameMode.Value = ""
local players = game.Players:GetChildren()
alert("Round Ended!",Color3.new(0,0.8,1))
for x = 1, #players do
pcall(function()
players[x].LeftWeapon.Value = "Pistol"
players[x].RightWeapon.Value = "Knife"
if players[x].Character:findFirstChild("Humanoid") then
players[x].Character.Humanoid.Health = 0
spectater:remove()
end
end)
end
wait(15)
for x = 1, #players do
if players[x]:findFirstChild("LeaderInfo") then
pcall(function()
players[x].LeaderInfo.Kills.Value = 0
players[x].LeaderInfo.Scores.Value = 0
players[x].LeaderInfo.Deaths.Value = 0
players[x].LeaderInfo.Team.Value = 0
end)
end
end
end
__________________________________________________________________
locals:
gtool = script.GameTool:clone()
gtoolr = script.GameTool:remove()
spectate = script.Spectate Q & E:clone()
spectater = script.Spectate Q & E:remove()
__________________________________________________________________
Game Rounds/Time:
roundTime = {
["Free for All"] = 600,
["Elimination"] = 300
}

Please fix!
Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
07 Jun 2013 11:16 PM
"Don't ask others to debug your broken code without giving a hint what sort of problem you are having. Posting a few hundred lines of code, saying "it doesn't work", will get you ignored. Posting a dozen lines of code, saying "after line 7 I was expecting to see (something), but (something else) happened instead" is much more likely to get you a reply."
Report Abuse
MMOfficial is not online. MMOfficial
Joined: 20 May 2013
Total Posts: 276
07 Jun 2013 11:17 PM
K thnx, gonna make another post. A re-post.
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