|
| 04 Aug 2013 12:25 AM |
| My tycoon game is a bit laggy and I want to remove 2 of 6 tycoons to make it less laggy, by changing the max players to 4. Is it possible? |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 04 Aug 2013 12:28 AM |
MaxPlayers = 4 game.Players.PlayerAdded:connect(function(Player) if game.Players.NumPlayer <= 4 then Player:Destroy() end end) |
|
|
| Report Abuse |
|
|
WishNite
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
|
| 04 Aug 2013 12:29 AM |
| It's not possible to set the MaxPlayers to 4, but you can kick anyone who joins when there is more than 4 people (There is no point to doing that, though) |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2013 12:29 AM |
what does the destroy function do for a player? For parts, it removes. Also, will after 4 players, then the 5th player will be in the new server? |
|
|
| Report Abuse |
|
|
WishNite
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
|
| 04 Aug 2013 12:30 AM |
:Destroy on a player essentially it kicks them.
No. |
|
|
| Report Abuse |
|
|
Explodey
|
  |
| Joined: 19 Jun 2013 |
| Total Posts: 1454 |
|
|
| 04 Aug 2013 12:30 AM |
| Nope. People will be raging and fighting over open servers. |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2013 12:31 AM |
Never mind then. Thanks for your help.
|
|
|
| Report Abuse |
|
|
Vector2D
|
  |
| Joined: 11 May 2013 |
| Total Posts: 195 |
|
|
| 04 Aug 2013 12:32 AM |
The minimum you can have is four. However, you could use a script like the one below to keep more players from joining, though they can't make a new server.
game:GetService('Players')['PlayerAdded']:connect(function(player) player:WaitForDataReady();
if (game:GetService('Players')['NumPlayers'] > 4) then player:Destroy(); end; end); |
|
|
| Report Abuse |
|
|
Vector2D
|
  |
| Joined: 11 May 2013 |
| Total Posts: 195 |
|
|
| 04 Aug 2013 12:34 AM |
| Apologies, minimum is six; I wasn't really paying attention. |
|
|
| Report Abuse |
|
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 04 Aug 2013 12:54 AM |
game.Players.PlayerAdded:connect(function(player) if game.Players.NumPlayers > 4 then player:Destroy() end end) |
|
|
| Report Abuse |
|
|
Vector2D
|
  |
| Joined: 11 May 2013 |
| Total Posts: 195 |
|
|
| 04 Aug 2013 12:58 AM |
@Useing That won't always work. |
|
|
| Report Abuse |
|
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 04 Aug 2013 01:07 AM |
My name isn't Useing so you're not talking to anyone
lol
besides that, how so? I works for me everytime I tried, I changed it to 0 and it worked over and over... |
|
|
| Report Abuse |
|
|
Vector2D
|
  |
| Joined: 11 May 2013 |
| Total Posts: 195 |
|
|
| 04 Aug 2013 01:31 AM |
@Useing Your name, to me, is now an incorrect spelling of 'Using'. Anyways; every time I've tried it (do note, I haven't touched Studio in a couple months), it'd work once, or twice, and immediately stop, whilst t'd continuously work after their data has been prepped for loading. |
|
|
| Report Abuse |
|
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 04 Aug 2013 02:36 AM |
| Ok then I just won't respond and think you're talking to someone else if you call me "Useing," I'll just think you're talking to someone else. |
|
|
| Report Abuse |
|
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 04 Aug 2013 02:37 AM |
@Vector, http://www.roblox.com/User.aspx?ID=28604773 |
|
|
| Report Abuse |
|
|
Vector2D
|
  |
| Joined: 11 May 2013 |
| Total Posts: 195 |
|
|
| 04 Aug 2013 01:07 PM |
@Useing You've already acknowledged that I am going to call you Useing. Your character looks cool. And, great, one less moron I have to deal with. |
|
|
| Report Abuse |
|
|