Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

2 comments

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

0

Still nothing. ;/

1 answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.