generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: disabling the players gui

Previous Thread :: Next Thread 
friendlyBoy15 is not online. friendlyBoy15
Joined: 17 Sep 2012
Total Posts: 511
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
friendlyBoy15 is not online. friendlyBoy15
Joined: 17 Sep 2012
Total Posts: 511
06 Mar 2015 06:28 PM
is it even possiable
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
06 Mar 2015 06:28 PM
destroy the GUI...

for i, v in pairs(game.Players:GetPlayers()) do
etc
end
Report Abuse
friendlyBoy15 is not online. friendlyBoy15
Joined: 17 Sep 2012
Total Posts: 511
06 Mar 2015 06:38 PM
that does not really help
Report Abuse
GeoVolcano is not online. GeoVolcano
Joined: 05 Jul 2012
Total Posts: 1433
06 Mar 2015 06:40 PM
It makes sense to me.
Report Abuse
friendlyBoy15 is not online. friendlyBoy15
Joined: 17 Sep 2012
Total Posts: 511
06 Mar 2015 06:41 PM
well do you think you could explain it?
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
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 is not online. 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
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
06 Mar 2015 06:45 PM
other guy's code is really really really bad
Report Abuse
IIIIIIlII is not online. IIIIIIlII
Joined: 06 Jan 2011
Total Posts: 710
06 Mar 2015 06:49 PM
This one? ^^
How can it be improved?
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
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
friendlyBoy15 is not online. friendlyBoy15
Joined: 17 Sep 2012
Total Posts: 511
06 Mar 2015 06:50 PM
idk how to improve it but it works thanks for helping
Report Abuse
IIIIIIlII is not online. IIIIIIlII
Joined: 06 Jan 2011
Total Posts: 710
06 Mar 2015 07:28 PM
Oh like :FindFirstChild(gui,true) ?
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
06 Mar 2015 07:30 PM
The second argument would make it recursive which isn't necessary.
Report Abuse
IIIIIIlII is not online. 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
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image