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
|
  |
| Joined: 22 Feb 2011 |
| Total Posts: 681 |
|
| |
|
|
| 23 Jul 2014 04:45 PM |
you bump when your post is about to go off the front page of posts.
|
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 22 Feb 2011 |
| Total Posts: 681 |
|
|
| 23 Jul 2014 04:50 PM |
| oh no its you who was reported |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2014 04:52 PM |
| he is somewhat helpful but is a troll |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2014 04:52 PM |
| i even made a script from scratch for u and ur being mean to me |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| Joined: 22 Feb 2011 |
| Total Posts: 681 |
|
|
| 23 Jul 2014 05:01 PM |
| better example please that makes 0% sense to me |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
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
|
  |
| Joined: 22 Feb 2011 |
| Total Posts: 681 |
|
|
| 23 Jul 2014 05:11 PM |
| dint work I need someone better |
|
|
| Report Abuse |
|
|
alvin1104
|
  |
| Joined: 22 Feb 2011 |
| Total Posts: 681 |
|
| |
|
|
| 23 Jul 2014 05:15 PM |
better then me? dont make me laugh |
|
|
| Report Abuse |
|
|
alvin1104
|
  |
| Joined: 22 Feb 2011 |
| Total Posts: 681 |
|
| |
|
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
|
  |
| 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
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
| |
|
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
|
  |
| 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 |
|
|