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
local player = game.Players.LocalPlayer
local groupid = 3555391
local fbi = script.Parent
local gui = game.StarterGui.ScreenGui


script.Parent.MouseButton1Click:connect(function()
    if player:IsInGroup(groupid) then
        fbi.Active = true
        player.TeamColor = BrickColor.new("Forest green")
    else
        fbi.Active = false
    end
end)

if player.TeamColor == BrickColor.new("Forest green") then
    gui.Active = false
    gui.Frame.Visible = false
    gui.Frame.Active = false
end

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?

local player = game.Players.LocalPlayer;
local groupid = 3555391;
local fbi = script.Parent;
local gui = player.PlayerGui.ScreenGui;

fbi.InputBegan:connect(function(input)
    if(input.UserInputType == Enum.UserInputType.MouseButton1)then
        if(player:IsInGroup(groupid))then
            fbi.Active = true;
            player.TeamColor = BrickColor.new("Forest green");
            gui.Frame.Visible = false;
            gui.Frame.Active = false;
            gui.Active = false;
        else
            fbi.Active = false;
        end
    end
end)
Ad

Answer this question