REM25
|
  |
| Joined: 28 Feb 2010 |
| Total Posts: 3154 |
|
|
| 02 Dec 2013 07:50 PM |
| How can I close the game if the player clicks a certain Gui button? Is this possible? Ex. Exit button and the whole game closes rather than the kick method |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2013 07:54 PM |
Well, I guess you can just kick everyone.
Remove everything?
function b(loc) for _,v in pairs(loc:GetChildren()) do if v:IsA("BasePart") and v.Name ~= "Terrain" and v.Name ~= "Camera" or v.Parent == game.Players then v:Destroy() else b( v ) end end end
script.Parent.MouseButton1Down:connect(function(p) b(game) end)
I suppose? |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 02 Dec 2013 08:27 PM |
^ That might work... But idk what happens if the player with the GUI gets kicked. Will the script still run?
A better idea might be while true do end in a normal script... |
|
|
| Report Abuse |
|
|
REM25
|
  |
| Joined: 28 Feb 2010 |
| Total Posts: 3154 |
|
|
| 02 Dec 2013 11:54 PM |
| First of all is it possible to close a game using a script? |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 03 Dec 2013 12:35 AM |
yush! kicking all the player disconnects the game!
all = game.Players:GetChildren() for i = 1,#all do all[i]:Kick()
|
|
|
| Report Abuse |
|
|
|
| 03 Dec 2013 12:36 AM |
| No you cannot close the window. |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
| |
|
|
| 03 Dec 2013 12:42 AM |
| Yes, it does shut down, but it does not close the window. It just disconnects and present the 'Shut down' GUI. |
|
|
| Report Abuse |
|
|
REM25
|
  |
| Joined: 28 Feb 2010 |
| Total Posts: 3154 |
|
|
| 03 Dec 2013 11:43 AM |
| Kev not only do I want them "kicked" I also want the game to close so yeah I don't think that's possible. |
|
|
| Report Abuse |
|
|
REM25
|
  |
| Joined: 28 Feb 2010 |
| Total Posts: 3154 |
|
| |
|
Adam2090
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 889 |
|
|
| 03 Dec 2013 06:14 PM |
| It is not possible to close the game client. But there are several ways to make it unresponsive. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 03 Dec 2013 06:15 PM |
You could crash them, but that's not really closing it... They would have to close it in order to stop lagging, so yeah.
while wait(1/44) do delay(0, function() while true do end end) end |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 03 Dec 2013 06:19 PM |
| Ok, no, it is NOT posssible for make then exit the window by a script, only by the red X. |
|
|
| Report Abuse |
|
|
REM25
|
  |
| Joined: 28 Feb 2010 |
| Total Posts: 3154 |
|
| |
|