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
 

need a little help

Previous Thread :: Next Thread 
welshcorgi101 is not online. welshcorgi101
Joined: 21 Nov 2009
Total Posts: 210
02 Aug 2011 12:27 AM
i have this script:
------------------------------------------------------------------------------------------
if game.Players.NumPlayers > 2 then
wait(1)
loc=Vector3.new(9,1,7)
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "Required amount of players has reached, starting momentarily..."
wait(3)
m:Remove()
wait(5)
for i, v in pairs(game.Players:children()) do
if v.Character then
v.Character:MoveTo(loc)
end
end
end
------------------------------------------------------------------------------------------
it checks if the number of players is greater than 2, and if it is, starts a message, and moves the players to the location.Question:will the first line work?
main Question:how will i make a script to where if all players die, the game resets and this script plays again?
Report Abuse
3465yoba is not online. 3465yoba
Joined: 31 Jul 2011
Total Posts: 377
02 Aug 2011 12:31 AM
plrs = game.Players:getChildren()
if #plrs > 2 then
--BLAH
end

~Get the water boiling... I'll get the cauldron and the seasoning...
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
02 Aug 2011 12:39 AM
local died = 0

game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
c.Humanoid.Died:connect(function()
died = died + 1
end)
end)
end)

while true do
if game.Players.NumPlayers > 2 then
wait(1)
loc=Vector3.new(9,1,7)
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "Required amount of players has reached, starting momentarily..."
wait(3)
m:Remove()
wait(5)
for i, v in pairs(game.Players:children()) do
if v.Character then
v.Character:MoveTo(loc)
end
end
repeat wait() until died == game.Players.NumPlayers
end
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
02 Aug 2011 12:40 AM
Oops, put another end at the bottom, and after the repeat loop, put:

died = 0
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