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

How to make a GUI Visible when a player is not in a group?

I am building team system, so there is a group team and a guest team, If the player is not in the group, I want the Group team overlay to be visible as well(So it is blocking the button for the group team) as well as a message, here's the script I have tried:

game.Players.PlayerAdded:Connect(function(player)
	local GroupID = 5572227
	if not player:IsInGroup(GroupID) then
		script.Parent.BackgroundTransparency = 0.9
		script.Parent.TextTransparency = 0.4
		game.StarterGui.TeamGui.Warriors.MayNotJoinTeam.Visible = true
		game.StarterGui.TeamGui.Warriors.CannotJoin.Visible = true
	end
end)

How do I make the script work?

4 comments

0

Have you tried if player:IsInGroup(GroupID) == false then instead?

0

No. Not yet.

0

It doesn't work still when I tried that.

0

This works for me, I gave an answer, though.

1 answer

I don't know why it isn't working fr you. Try this.


game.StarterGui.TeamGui.Warriors.MayNotJoinTeam.Visible = true
        game.StarterGui.TeamGui.Warriors.CannotJoin.Visible = true

game.Players.PlayerAdded:Connect(function(player)
    local GroupID = 5572227
    if player:IsInGroup(GroupID) then
        script.Parent.BackgroundTransparency = 0.9
        script.Parent.TextTransparency = 0.4
        player.PlayerGui.TeamGui.Warriors.MayNotJoinTeam.Visible = false
        player.PlayerGui.TeamGui.Warriors.CannotJoin.Visible = false
    end
end)

1 comment

0

There may be a few errors, I typed this manually

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