Ripull
|
  |
| Joined: 21 Jul 2008 |
| Total Posts: 14249 |
|
|
| 24 May 2014 02:15 PM |
Anyone notice that this doesn't work very well under latency issues? Usually, the player's backpack GUI half forms on respawn after calling this method.
I'm trying to make a fool-proof disabler, that disregards latency and just gets its job done. Can I get some help to make this less likely to fail?
repeat wait() until game.Players.LocalPlayer.Character and game.Players.LocalPlayer.PlayerGui
function Clear() local StarterGui = Game:GetService("StarterGui"); Settings = { false,--PlayerList false,--Health false,--Backpack false}--Chat
--[[StarterGui:WaitForChild("Health"); print'passed 1' StarterGui:WaitForChild("Backpack"); print'passed 2' StarterGui:WaitForChild("Chat"); print'passed 3' StarterGui:WaitForChild("PlayerList"); print'passed 4']]--
for _,i in pairs(Settings) do StarterGui:SetCoreGuiEnabled(_-1,i); end
end Clear() |
|
|
| Report Abuse |
|
|
Devoi
|
  |
| Joined: 09 Jun 2013 |
| Total Posts: 5387 |
|
|
| 24 May 2014 02:16 PM |
| set them all to true first, have a small delay, then set whichever ones you want to false. |
|
|
| Report Abuse |
|
|
Ripull
|
  |
| Joined: 21 Jul 2008 |
| Total Posts: 14249 |
|
|
| 24 May 2014 02:18 PM |
| Why should I set them to true first, when by default they are true? |
|
|
| Report Abuse |
|
|
|
| 24 May 2014 02:18 PM |
Lol,why is this so long exactly?
Localscript in startergui
while wait() do game.StarterGui:SetCoreGuiEnabled("All",false) end |
|
|
| Report Abuse |
|
|
Ripull
|
  |
| Joined: 21 Jul 2008 |
| Total Posts: 14249 |
|
|
| 24 May 2014 02:19 PM |
I tend to not like loops running in the background of my game. I try to avoid them at all costs. |
|
|
| Report Abuse |
|
|
|
| 24 May 2014 02:20 PM |
Under stress tests, the guis showed back up..
So its best to use a loop.. |
|
|
| Report Abuse |
|
|
Ripull
|
  |
| Joined: 21 Jul 2008 |
| Total Posts: 14249 |
|
|
| 24 May 2014 02:24 PM |
I guess for now it's going to be the best solution I'm gonna be able to use.
Would you suggest changing the wait() to wait(1), or great though? |
|
|
| Report Abuse |
|
|