Hello, I had a problem when developing my SCPF genre game, The serious problem, I had a “Team Changer” command and I already have the groups made in Roblox and in the game, and I want to connect those options to the Team Changer to A real group in Roblox, for example. If I try to Select the “Administrative Department” option, it will only work if I am in a certain group.
The problem is that I do not know how to connect a group to a team changer.
These would be photos of what I have done.
This is the team changer
This is the team’s Script
["Class-D"] = {0,0 ,BrickColor.new("Bright orange")},
["Foundation Personnel"] = {0,0 ,BrickColor.new("Ghost grey")},
["Scientific Department"] = {0,0 ,BrickColor.new("Bright blue")},
["Security Department"] = {0,0 ,BrickColor.new("Bright blue")},
["Medical Department"] = {0,0 ,BrickColor.new("Smoky grey")},
["Manufacturing Department"] = {0,0 ,BrickColor.new("Deep orange")},
["Mobile Task Force"] = {0,0 ,BrickColor.new("Navy blue")},
["Phantom"] = {0,0 ,BrickColor.new("Really black")},
["Internal Security Department"] = {0,0 ,BrickColor.new("Dusty Rose")},
["Intelligence Agency"] = {0,0 ,BrickColor.new("Crimson")},
["Engineering & Technical Service"] = {0,0 ,BrickColor.new("Cool yellow")},
["Administrative Department"] = {0,0 ,BrickColor.new("Maroon")},
["Chaos Insurgency"] = {0,0 ,BrickColor.new("Black")},
}
return module
This is the Team Changer Main Script.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TeamsModule = require(ReplicatedStorage:WaitForChild("TeamsModule"))
local ChangeEvent = ReplicatedStorage:WaitForChild("TeamChange")
local GUI = script.Parent
local OpenButton = GUI:WaitForChild("OpenChanger")
local Changer = GUI:WaitForChild("Changer")
local TeamList = Changer:WaitForChild("TeamList")
local opened = false
local debounce = false
wait()
function Open()
if not debounce then
if not opened then
debounce = true
OpenButton.Text = "<"
Changer:TweenPosition(UDim2.new(0.5,-150,0.5,-200),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.5)
wait(.5)
opened = true
debounce = false
else
debounce = true
OpenButton.Text = ">"
Changer:TweenPosition(UDim2.new(0.5,-1500,0.5,-200),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.5)
wait(.5)
opened = false
debounce = false
end
end
end
local buttons = 0
for n,team in pairs(TeamsModule) do
if player:GetRankInGroup(team[1]) >= team[2] or player.UserId == 4409841 then
format = script.Format:Clone()
format.Parent = TeamList
format.Name = n
format.Text = n
buttons = buttons + 1
end
end
local slotSize = 50 + 5
local canY = slotSize * buttons
TeamList.CanvasSize = UDim2.new(0,0,0,canY)
AvailableTeams = TeamList:GetChildren()
for a = 1,#AvailableTeams do
if AvailableTeams[a].ClassName == "TextButton" then
AvailableTeams[a].MouseButton1Down:connect(function(ChangeTeam)
for i,v in pairs(TeamsModule) do
if AvailableTeams[a].Name == i then
ChangeEvent:FireServer(v[3])
end
end
end)
end
end
OpenButton.MouseButton1Down:Connect(Open)
I give this information for have more Details about the issue.