|
| 06 Mar 2015 06:25 PM |
How to make a script in ServerScriptService go into all of the players and disable a gui
Any help? |
|
|
| Report Abuse |
|
|
| |
|
|
| 06 Mar 2015 06:28 PM |
destroy the GUI...
for i, v in pairs(game.Players:GetPlayers()) do etc end |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 06 Mar 2015 06:41 PM |
| well do you think you could explain it? |
|
|
| Report Abuse |
|
|
|
| 06 Mar 2015 06:42 PM |
For every player, check if they have the GUI, and if they do, destroy it.
Ofc this won't work with FE so it's awful code, but yeah. |
|
|
| Report Abuse |
|
|
IIIIIIlII
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 710 |
|
|
| 06 Mar 2015 06:44 PM |
Loop through the All the players' Gui through Player.PlayerGui
local guiname = "HI" for k,v in pairs(game.Players:GetChildren()) do local pg = v:FindFirstChild("PlayerGui") if pg then for k,w in pairs(pg:GetChildren()) do if w.Name == guiname then w:Destroy() end end end
ja?
|
|
|
| Report Abuse |
|
|
|
| 06 Mar 2015 06:45 PM |
| other guy's code is really really really bad |
|
|
| Report Abuse |
|
|
IIIIIIlII
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 710 |
|
|
| 06 Mar 2015 06:49 PM |
This one? ^^ How can it be improved? |
|
|
| Report Abuse |
|
|
|
| 06 Mar 2015 06:50 PM |
| you don't need to loop through it just check if the GUI exists and if it does findfirstchild it and destroy |
|
|
| Report Abuse |
|
|
|
| 06 Mar 2015 06:50 PM |
| idk how to improve it but it works thanks for helping |
|
|
| Report Abuse |
|
|
IIIIIIlII
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 710 |
|
|
| 06 Mar 2015 07:28 PM |
| Oh like :FindFirstChild(gui,true) ? |
|
|
| Report Abuse |
|
|
|
| 06 Mar 2015 07:30 PM |
| The second argument would make it recursive which isn't necessary. |
|
|
| Report Abuse |
|
|
IIIIIIlII
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 710 |
|
|
| 06 Mar 2015 07:37 PM |
But since the gui is located: Player>PlayerGui>Gui, would'nt recursion be helpful?? |
|
|
| Report Abuse |
|
|
|
| 06 Mar 2015 07:38 PM |
Nah, because all you need to do is destroy the entire GUI with a name you already know.
|
|
|
| Report Abuse |
|
|