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: Do something when Num of players in team reaches one?

Previous Thread :: Next Thread 
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
23 Jul 2014 04:42 PM
Hi, i'm currently making a game script and need some help. When the number of players in a pastel brown team called Lobby gets to one player, make a message saying "Win". If the game goes on for over 90 seconds and there's more than one player in the team still, make a message saying "Loss".

Thanks!
Report Abuse
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
23 Jul 2014 04:44 PM
Bump.
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
23 Jul 2014 04:45 PM
you bump when your post is about to go off the front page of posts.

Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
23 Jul 2014 04:48 PM
dont feel like doing the 90 seconds ok

locaI virus = 0
whiIe true do
for _, v in pairs(game.PIayers:GetPlayers()) do
if v.TeamColor == BrickCoIor.new("PasteI brown") then
virus = virus + 1
end
end
if virus == 1 then
local infected = Instance.new("Message", Workspace)
infected.Text = str.rep("Win", 1000)
end
end
Report Abuse
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
23 Jul 2014 04:50 PM
oh no its you who was reported
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
23 Jul 2014 04:52 PM
he is somewhat helpful but is a troll
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
23 Jul 2014 04:52 PM
i even made a script from scratch for u and ur being mean to me
Report Abuse
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
23 Jul 2014 04:55 PM
yeah but you've made a dodgy virus that would've crashed studio
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
23 Jul 2014 04:57 PM
oops sorry

whiIe wait() do
locaI virus = 0
for _, v in pairs(game.PIayers:GetPlayers()) do
if v.TeamColor == BrickCoIor.new("PasteI brown") then
virus = virus + 1
end
end
while virus then
local infected = Instance.new("Message", Workspace)
infected.Text = str.rep("Win", 1000)
end
end
Report Abuse
AnonyAnonymous is not online. AnonyAnonymous
Joined: 23 Jun 2013
Total Posts: 6332
23 Jul 2014 05:00 PM
Actually, the first half is an example of a method to get the number of players on the team.
Report Abuse
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
23 Jul 2014 05:01 PM
better example please that makes 0% sense to me
Report Abuse
InfamousGorillas is not online. InfamousGorillas
Joined: 22 Apr 2014
Total Posts: 52
23 Jul 2014 05:02 PM
then ur just stopid

Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
23 Jul 2014 05:02 PM
just test it
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
23 Jul 2014 05:03 PM
^^ XD
Report Abuse
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
23 Jul 2014 05:08 PM
well i removed the string mania as it would say win 1000 times and corrected your L's
Report Abuse
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
23 Jul 2014 05:11 PM
dint work I need someone better
Report Abuse
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
23 Jul 2014 05:15 PM
cause hes a troll
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
23 Jul 2014 05:15 PM
better then me?
dont make me laugh
Report Abuse
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
23 Jul 2014 05:39 PM
PLEASE HELP
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
23 Jul 2014 05:44 PM
function check()
local x = 0
for _,v in pairs (Game.Players:GetChildren()) do
x = x + (v.TeamColor == BrickColor.new("Bright blue") and 1 or 0)
end
if x >= 5 then
print("5 or more people on the bright blue team")
--code
end
end

function newPlayer(Player)
Player.Changed:connect(check)
check()
end
Game.Players.PlayerAdded:connect(newPlayer)
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
23 Jul 2014 05:44 PM
timer = 0

while true do
plrs = game.Players:GetPlayers()
for i, v in pairs (plrs) do
if v.TeamColor == "Pastel brown" then
m = Instance.new("Message", workspace)
m.Text = "WIN"
break
end
end
wait(1)
timer = timer + 1
if timer >= 90 then
m = Instance.new("Message", workspace)
m.Text = "LOSE"
break
end
end
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
23 Jul 2014 05:45 PM
@Kod
while loop < .Changed
Report Abuse
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
24 Jul 2014 03:35 AM
I dont understand and it does not work please can someone else post something
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
24 Jul 2014 08:54 AM
localPlayer = game.Players.LocalPlayer

timer = 0

local timerChange = coroutine.create(function()
while wait(1) do
timer = timer + 1
if timer >= 90 then
m = Instance.new("Message", workspace)
m.Text = "LOSE!"
end
end
end)

coroutine.resume(timerChange)

localPlayer.Changed:connect(function(property)
if property == "TeamColor" then
if localPlayer.TeamColor == "Pastel brown" then
m = Instance.new("Message", workspace)
m.Text = "WIN!"
coroutine.yeild(timerChange)
end
end
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