I understand the use of arrays / tables but with my current system that would clash with stuff so I’m wondering if I could make it appropriate for my current set (apologise for not showing at the start)
script.Parent.GroupGuiFrame.Visible = false
script.Parent.GroupGuiFrame.GroupListFrame.Visible = true
local Frame = script.Parent.GroupGuiFrame
local Open = false
local PositionClosed = UDim2.new(0.5, 0,-1.5, 0)
local PositionOpen = UDim2.new(0.5, 0,0.5, 0)
local UserInputService = game:GetService(“UserInputService”)
UserInputService.InputBegan:Connect(function(keyCode)
if keyCode.KeyCode == Enum.KeyCode.P then
if Open then
Frame:TweenPosition((PositionClosed), “Out”,“Linear”,.5)
Open = false
Frame.Visible = true
task.wait(.5)
else
Open = true
Frame:TweenPosition((PositionOpen), “Out”,“Linear”,.5)
Frame.Visible = true
task.wait(.5)
end
end
end)
local creatingGroup = false
local inGroup = false
script.Parent.GroupGuiFrame.CreateButton.MouseButton1Click:Connect(function()
if inGroup then return end
creatingGroup = not creatingGroup
if creatingGroup then
script.Parent.GroupGuiFrame.CreateButton.Text = "RETURN"
script.Parent.GroupGuiFrame.CreateFrame.Visible = true
script.Parent.GroupGuiFrame.GroupListFrame.Visible = false
else
script.Parent.GroupGuiFrame.CreateButton.Text = "CREATE A GROUP"
script.Parent.GroupGuiFrame.GroupListFrame.Visible = true
script.Parent.GroupGuiFrame.CreateFrame.Visible = false
end
end)
game.ReplicatedStorage.InviteSystemRE.OnClientEvent:Connect(function(joiningGroup, groupName)
inGroup = joiningGroup and true or false
if inGroup then
script.Parent.GroupGuiFrame.GroupFrame.GroupTitle.Text = groupName
script.Parent.GroupGuiFrame.GroupFrame.Visible = true
script.Parent.GroupGuiFrame.GroupListFrame.Visible = false
script.Parent.GroupGuiFrame.CreateButton.Visible = false
local function displayPlayers()
for i, child in pairs(script.Parent.GroupGuiFrame.GroupFrame.PlayerList:GetChildren()) do
if child:IsA("Frame") then
child:Destroy()
end
end
for i, player in pairs(game.ReplicatedStorage.Invites[groupName].Players:GetChildren()) do
local template = script.PlayerTemplate:Clone()
template.PlayerName.Text = player.Value
if game.Players.LocalPlayer.Name ~= game.ReplicatedStorage.Invites[groupName].Players["Group Leader"].Value and game.Players.LocalPlayer.Name ~= player.Value then
template.LeaveButton:Destroy()
print("e")
else
template.LeaveButton.MouseButton1Click:Connect(function()
game.ReplicatedStorage.InviteSystemRE:FireServer("kickPlayer", groupName, player)
end)
end
template.Parent = script.Parent.GroupGuiFrame.GroupFrame.PlayerList
script.Parent.GroupGuiFrame.GroupFrame.PlayerList.CanvasSize = UDim2.new(0, 0, 0, script.Parent.GroupGuiFrame.GroupFrame.PlayerList.UIListLayout.AbsoluteContentSize.Y)
end
end
displayPlayers()
game.ReplicatedStorage.Invites[groupName].Players.ChildAdded:Connect(displayPlayers)
game.ReplicatedStorage.Invites[groupName].Players.ChildRemoved:Connect(displayPlayers)
else
script.Parent.GroupGuiFrame.GroupListFrame.Visible = true
script.Parent.GroupGuiFrame.GroupFrame.Visible = false
script.Parent.GroupGuiFrame.CreateButton.Visible = true
end
end)
script.Parent.GroupGuiFrame.CreateFrame.ConfirmButton.MouseButton1Click:Connect(function()
local groupName = game.Players.LocalPlayer.Name .. "'s Group"
local playerLimit = tonumber(script.Parent.GroupGuiFrame.CreateFrame.PlayerLimitBox.Text) or 8
game.ReplicatedStorage.InviteSystemRE:FireServer("createGroup", groupName, playerLimit)
creatingGroup = false
script.Parent.GroupGuiFrame.CreateButton.Text = "CREATE A Group"
script.Parent.GroupGuiFrame.GroupListFrame.Visible = true
script.Parent.GroupGuiFrame.CreateFrame.Visible = false
end)
function updateGroupList()
for i, child in pairs(script.Parent.GroupGuiFrame.GroupListFrame:GetChildren()) do
if child:IsA("Frame") then
child:Destroy()
end
end
for i, Group in pairs(game.ReplicatedStorage.Invites:GetChildren()) do
local groupName = Group.Name
local playerLimit = Group:WaitForChild("PlayerLimit").Value
local playerCount = #Group.Players:GetChildren()
local template = script.GroupTemplate:Clone()
template.GroupName.Text = groupName
template.PlayerCount.Text = playerCount .. "/" .. playerLimit
Group.Players.ChildAdded:Connect(function() template.PlayerCount.Text = #Group.Players:GetChildren() .. "/" .. playerLimit end)
Group.Players.ChildRemoved:Connect(function() template.PlayerCount.Text = #Group.Players:GetChildren() .. "/" .. playerLimit end)
template.Parent = script.Parent.GroupGuiFrame.GroupListFrame
script.Parent.GroupGuiFrame.GroupListFrame.CanvasSize = UDim2.new(0, 0, 0, script.Parent.GroupGuiFrame.GroupListFrame.UIListLayout.AbsoluteContentSize.Y)
template.JoinButton.MouseButton1Click:Connect(function()
game.ReplicatedStorage.InviteSystemRE:FireServer("joinGroup", groupName)
end)
end
end
updateGroupList()
game.ReplicatedStorage.Invites.ChildAdded:Connect(updateGroupList)
game.ReplicatedStorage.Invites.ChildRemoved:Connect(updateGroupList)
I pretty much whimed this off of a tutorial as previously said I’m learning
but could there be a way to insert them into a folder in the workspace instead to use :GetChildren() or how would that work as when they are stationed in a group the gui and remote signals them into a value in replicatedstorage so if that was scanned would that be accessible to then teleport the person I’ve seen tutorials do it but my main problem is that there’s two folders which the players go in Invites.(persons party).Players again apologies,