Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Gui remover when it appears?

Asked by 5 years ago

This is a local script located in StartGui,but it will be only for one team. I have a flash grenade tool,and I want the team called "S.W.A.T" not to be affected by the flash, so, this script should remove the GUI instantly, but, it doesn't work, why?

The "GuiMain" isn't located in StartGui, it appears when the grenade flashes you. Filtering Enabled.

while true do
    if script.Parent.GuiMain.Disabled == false then
        script.Parent.GuiMain:Destroy()
    end
end

0
lol poor guy kingleonlion 2 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Might want to add a ~~~~~~~~~~~~~~~~~ wait() ~~~~~~~~~~~~~~~~~ in the while loop. Also, if the GuiMain isn't located in StarterGui then you can't locate it. Instead, in the grenade script, check if the player's team is S.W.A.T and if it is then the GUI showing code doesn't run as well as the damage code.

Ad

Answer this question