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 Alteration Challenge

Previous Thread :: Next Thread 
drc3 is not online. drc3
Joined: 14 Aug 2009
Total Posts: 1284
06 Apr 2014 02:06 AM
This is a minigame script I have, and it each round ends when the time runs out (90 seconds per round). I was wondering if someone could help me with this:

I need the game to end if there is only one player left alive, or if the time runs out. Can someone please help me?

Here is the script:


while true do
wait(5)
local m = math.random(1,1)
local player = game.Players:GetPlayers()
for i = 1, #player do
msg = Instance.new("Hint")
msg.Parent = nil
if m == 1 then
msg.Parent = game.Workspace
msg.Text = "Choosing Map."
wait(1)
msg.Text = "Choosing Map.."
wait(1)
msg.Text = "Choosing Map..."
wait(1)
msg.Text = "A Map has been chosen!"
wait(3)
msg.Text = "The Map is..."
wait(3)
msg.Text = "Raft"
wait(2)
msg.Text = "Survive the Round!"
wait(5)
msg.Text = "The game will be starting in:"
wait(1)
msg.Text = "...3..."
wait(1)
msg.Text = "..2.."
wait(1)
msg.Text = ".1."
wait(1)
msg.Text = "Begin!"
wait(1)
for i,v in pairs(game.Players:GetPlayers()) do
local x = {
[1] = Vector3.new(416,110.4,-162);
[2] = Vector3.new(426,110.4,-162);
[3] = Vector3.new(421,110.4,-162)
}
v.Character:MoveTo(x[math.random(1,#x)])
end
msg:remove()
game.Lighting.Field1:clone().Parent = game.Workspace
wait(90)
msg.Parent = game.Workspace
msg.Text = "Winner(s)!"
wait(3)
msg:remove()
game.Workspace.Field1:Remove()
msg.Parent = game.Workspace
msg.Text = "Intermission"
wait(20)
msg:remove()
end
end
end
Report Abuse
drc3 is not online. drc3
Joined: 14 Aug 2009
Total Posts: 1284
06 Apr 2014 11:22 PM
Bump.
Report Abuse
Vexeris is not online. Vexeris
Joined: 03 Apr 2014
Total Posts: 468
06 Apr 2014 11:26 PM
if Numplayers = 1 then
Game.Players:remove()
Report Abuse
drc3 is not online. drc3
Joined: 14 Aug 2009
Total Posts: 1284
06 Apr 2014 11:32 PM
Im not quite sure how those lines fit into this???
Report Abuse
Vexeris is not online. Vexeris
Joined: 03 Apr 2014
Total Posts: 468
06 Apr 2014 11:33 PM
fail i fixed it
if Numplayers == 1 then
Game.Players:remove() end
put it at the end of ur script
Report Abuse
Vexeris is not online. Vexeris
Joined: 03 Apr 2014
Total Posts: 468
06 Apr 2014 11:33 PM
no wait put it on another script , Lol
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
06 Apr 2014 11:46 PM
So troll... lol.

Too bad you can't remove the GameService!

Your problem is you have everything needed in that script, but you didn't make it. Please learn how 2 code b 4 posting.
Report Abuse
drc3 is not online. drc3
Joined: 14 Aug 2009
Total Posts: 1284
07 Apr 2014 12:04 AM
@ Vex, wait what???
Report Abuse
drc3 is not online. drc3
Joined: 14 Aug 2009
Total Posts: 1284
07 Apr 2014 08:10 PM
Bump.
Report Abuse
drc3 is not online. drc3
Joined: 14 Aug 2009
Total Posts: 1284
07 Apr 2014 08:22 PM
Buuuuuuummmmpppp.
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
07 Apr 2014 08:27 PM
Why is there a for I loop at the top?
Report Abuse
drc3 is not online. drc3
Joined: 14 Aug 2009
Total Posts: 1284
07 Apr 2014 08:45 PM
In the entirety of the script I have it is more than that.
Report Abuse
drc3 is not online. drc3
Joined: 14 Aug 2009
Total Posts: 1284
07 Apr 2014 09:38 PM
Bump.
Report Abuse
drc3 is not online. drc3
Joined: 14 Aug 2009
Total Posts: 1284
08 Apr 2014 01:20 AM
Bump, I need this minigame script to end a minigame when either one player is left, or if the time runs out.


Can anyone help me? :)
Report Abuse
drc3 is not online. drc3
Joined: 14 Aug 2009
Total Posts: 1284
08 Apr 2014 08:11 PM
Budump...
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
10 Apr 2014 04:09 PM
A mini-game script would have the following.

The setup
A lobby queue wait
A game (which checks for players alive/playing)
A cleanup

In the setup i would create a table. When the lobby queue switches to the game, insert all player names into the table. Used humanoid.died events to remove them from this table

The game you can handle yourself.

The cleanup you can handle yourself.

Here:

players ={}

function movePlayers()
for i, v in pairs(game.Players:getChildren())do
players[v.Name] = v.Character
end
end

function start_game()

end

function clearTable()
players = {}
end

function cleanup()
clearTable()
wait(20)
start_game()
end

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