I’m currently in the works of making a club, and the requirement is that you need to be in the group to enter the club. They can still join the game and walk around but they can only stay in the main area until they join the group. In order to get them to join the group I made a gui that will only become visible if the player is not in the group. I’m currently having an issue where the gui will stay visible even if a player is in the group.
game.Players.PlayerAdded:Connect(function(newPlayer)
if newPlayer:IsInGroup(5917382) then
game.StarterGui.NoticeGui:GetChildren("TextLabel").Visible = false
else
game.StarterGui.NoticeGui:GetChildren("TextLabel").Visible = true
end
end)
game.Players.PlayerAdded:Connect(function(newPlayer)
if newPlayer:IsInGroup(5917382) then
NewPlayer.PlayerGui.NoticeGui:GetChildren("TextLabel").Visible = false
else
NewPlayer.PlayerGui.NoticeGui:GetChildren("TextLabel").Visible = true
end
end)
At the moment your editing the UI that would spawn into players PlayerGui by editing StaterGui
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connection(function(Character)
local PlayerGui = Player:WaitForChild("PlayerGui")
local NoticeGui = PlayerGui:WaitForChild("NoticeGui")
if Player:IsInGroup(5917382) then
NoticeGui:GetChildren("TextLabel").Visible = false
else
NoticeGui:GetChildren("TextLabel").Visible = true
end
end)
end)
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded(Character)
local PlayerGui = Player:WaitForChild("PlayerGui")
local NoticeGui = PlayerGui:WaitForChild("NoticeGui")
if Player:IsInGroup(5917382) then
NoticeGui.Enabled = false
else
NoticeGui.Enabled = true
end
end)
Player.CharacterAdded(Character) is still shown as an unknown global