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

Why isn't my gui disappearing after I have probably done everything ,probably, correctly?

Asked by
hopup 15
7 years ago
01local player = game.Players.LocalPlayer
02local groupid = 3555391
03local fbi = script.Parent
04local gui = game.StarterGui.ScreenGui
05 
06 
07script.Parent.MouseButton1Click:connect(function()
08    if player:IsInGroup(groupid) then
09        fbi.Active = true
10        player.TeamColor = BrickColor.new("Forest green")
11    else
12        fbi.Active = false
13    end
14end)
15 
16if player.TeamColor == BrickColor.new("Forest green") then
17    gui.Active = false
18    gui.Frame.Visible = false
19    gui.Frame.Active = false
20end
0
You're changing the GUI that is inside StarterGui instead of the GUI that is inside the Player. You're going to want to try something like this: player.PlayerGui:FindFirstChild("WhateverTheScreenGUIsNameIs").Frame.Visible = false zyrun 168 — 7y
0
Still nothing. ;/ hopup 15 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

I don't know how your game is laid out, so I can only be of limited help. For example, what is fbi?

01local player = game.Players.LocalPlayer;
02local groupid = 3555391;
03local fbi = script.Parent;
04local gui = player.PlayerGui.ScreenGui;
05 
06fbi.InputBegan:connect(function(input)
07    if(input.UserInputType == Enum.UserInputType.MouseButton1)then
08        if(player:IsInGroup(groupid))then
09            fbi.Active = true;
10            player.TeamColor = BrickColor.new("Forest green");
11            gui.Frame.Visible = false;
12            gui.Frame.Active = false;
13            gui.Active = false;
14        else
15            fbi.Active = false;
16        end
17    end
18end)
Ad

Answer this question