How Would I Make This Code Joining System? (Updated)

Hey, so I made a system where a player can create a random code (let’s call that player the owner). Now I want to make a system where if another player enters the code they join the owner’s group/party/clan. How would I make it so the player can still join the owner’s group even when the owner is offline and if the owner is in a different server?

This is in the server

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local ownedClasses = {}

local function addClass(player, success)

ownedClasses[player] = success

for key, value in pairs(ownedClasses) do

print(key, value)

end

end

ReplicatedStorage.AddClass.OnServerEvent:Connect(addClass)

TL;DR: How would I make a class joining system like google classroom?

Thanks!

1 Like

Idk your game, but you can do this system: create a new table with a key and the code the key will be the owner of the classroom group and the code will be the actual code.

Key Code
bootsareme x85hgj4
Play_MazeOfHeck x94ng09

To do this you are going to have to create a 2d lua table, then use the table.insert method to insert your respective codes into their owners.

1 Like

Hey, did you mean something like this? I didn’t really know what you meant by 2d lua table.

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local ownedClasses = {}

local function addClass(player, success)

ownedClasses[player] = success

for key, value in pairs(ownedClasses) do

print(key, value)

end

end

ReplicatedStorage.AddClass.OnServerEvent:Connect(addClass)