|
| 11 Nov 2014 03:19 PM |
| im trying to create a script where it checks if players have a gui..and if they have it then it gets removed |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Nov 2014 03:41 PM |
| Does it gui have a name? Or something else? |
|
|
| Report Abuse |
|
|
inapt
|
  |
| Joined: 04 Oct 2008 |
| Total Posts: 11666 |
|
|
| 11 Nov 2014 03:59 PM |
http://wiki.roblox.com/index.php?title=API:Class/Instance/FindFirstChild
-ForeverDev |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2014 04:01 PM |
Just check if it exists and remove it?
if Player.PlayerGui:FindFirstChild("Gui") then Player.PlayerGui:FindFirstChild("Gui"):Destroy() end |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2014 04:05 PM |
"if Player.PlayerGui:FindFirstChild("Gui") then Player.PlayerGui:FindFirstChild("Gui"):Destroy()"
Uh, I'm pretty sure this way uses less resources and is more efficient. if Player.PlayerGui:FindFirstChild("Gui") then Player.PlayerGui.Gui:Destroy() |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2014 04:07 PM |
@Jarod If you consider a few bytes less resources then sure.
|
|
|
| Report Abuse |
|
|