local Player = game.Players.LocalPlayer
local Debris = game:GetService('Debris')
local Main = script.Parent.MainWindow
local Mouse = Player:GetMouse()
local Cam = game.Workspace.CurrentCamera
local Events = game.Workspace.Events
local Items = game.ReplicatedStorage.Modules_Basic
TeamChange = Player.PlayerGui.TeamChange
HMA = TeamChange.HMA
Raiders = TeamChange.Raiders
Player.CharacterAdded:wait() -- Adds a few bits of back-up,
-- // Faction Settings
Pos = Main.Factions_Frame.Example_Log.Position
OnFirst = true
-- Grabs all the factions,
for i,v in pairs(Items.Factions:GetChildren()) do
if OnFirst == true then
local new_log = Main.Factions_Frame.Example_Log:Clone()
new_log.Parent = Main.Factions_Frame
new_log.Text = v.Faction_Name.Value
new_log.Name = v.Name
new_log.Position = Pos
new_log.Visible = true
new_log.Faction_Info.Text = v.Faction_Info.Value
wait(0.005)
Pos = new_log.Position
OnFirst = false
if player:IsInGroup(127081) then HMA.MouseButton1Down:connect(function()
Player.TeamColor = BrickColor.new("Cyan")
Player.Character:BreakJoints()
end)
else
local new_log = Main.Factions_Frame.Example_Log:Clone()
new_log.Parent = Main.Factions_Frame
new_log.Text = v.Faction_Name.Value
new_log.Faction_Info.Text = v.Faction_Info.Value
new_log.Name = v.Name
new_log.Position = Pos + UDim2.new(0,0,0,60)
new_log.Visible = true
wait(0.005)
Pos = new_log.Position
end
end
-- // Faction Settings
So I am trying to make it where if you click on the gui button you will join the team if your in a certian group but for some odd reason it won't work. Anyone mind helping?

1 comment
Okay when I use spawns in game it will remove the teams gui