How do I load matchmaking/created party data onto a gui?

I am trying to make a party/matchmaking system for a game. Right now, this is the script for the creation of the server

main.Create.MouseButton1Click:Connect(function()
	sounds.Click:Play()
	if private and main.Private.Password.Input.Text == "" then
		notification("error", "Invalid password for private game.")
	elseif currentmap == nil then
		notification("error", "No map selected, which is not supposed to happen. Please contact the owner if you get this warning.")
	else
		notification("success", "Successfully created a server!")
		game.ReplicatedStorage.ServerSignal_Server:FireServer(main.ServerName.Text, private, currentmap, main.Difficulty.Dropdown.Text, main.Private.Password.Input.Text, game.Players.LocalPlayer.UserId)
		script.Parent.Visible = false
		script.Parent.Parent.InServer.Visible = true
	end
	--for any readers: notification is a function i made somewhere back in the script that isn't shown here
	--Remote event passthroughs: Server Name, private status, the map, difficulty, private password, creator userid
end)

The server script just fires another remote event with the same variables passing through (fire all client)

And this is the other client script

game.ReplicatedStorage.ServerSignal_Client.OnClientEvent:Connect(function(ServerName, Private: boolean, Map: ValueBase, difficulty, PrivatePassword: string, creator: number)
	local server = script.Parent.ScrollingFrame.Items.ServerChild:Clone()
	server.Parent = script.Parent.ScrollingFrame
	server.Visible = true
	server.ServerName.Text = ServerName
	server.Map.Text = Map.Value
	if Private then
		server.Joinability.Text = "Private"
		server.Joinability.TextColor3 = Color3.fromRGB(172, 176, 198)
	else
		server.Joinability.Text = "Public"
		server.Joinability.TextColor3 = Color3.fromRGB(133, 234, 106)
	end
	
	if difficulty == "EASY" then
		server.Difficulty.Text = "Easy"
		server.Difficulty.TextColor3 = Color3.fromRGB(171, 255, 115)
	elseif difficulty == "NORMAL" then
		server.Difficulty.Text = "Normal"
		server.Difficulty.TextColor3 = Color3.fromRGB(227, 205, 41)
	elseif difficulty == "HARD" then
		server.Difficulty.Text = "Hard"
		server.Difficulty.TextColor3 = Color3.fromRGB(227, 0, 61)
	elseif difficulty == "VERY HARD" then
		server.Difficulty.Text = "Very Hard"
		server.Difficulty.TextColor3 = Color3.fromRGB(154, 21, 112)
	end
	server.Players.PlayerAmount.Value += 1
	server.Players.Text = "[ 1/6 ]"
end)

This is all I’ve managed to get done, but I am stuck here. I have no idea how to load the information onto another frame (where it shows difficulty, players, and other stuff). I genuinely don’t know how to pull this off and I’m just stuck here. Basically, I want it so that when a player clicks the join button on the cloned “server” gui, a new gui appears and it applies all the information about the server they joined onto the gui. I’m pretty sure it has something to do with tables??

I also have no idea how to make the join button work. I don’t know how to make it interactable once it’s cloned onto the scrolling frame (there are no scripts inside the “server” gui where the join button is located).

2 Likes

Perhaps I could have worded this better… I’m trying to get the information of a party (ex: the players, the map, and other stuff) applied onto a gui but I don’t know how to do it.

I’m trying to make it so that when a player joins a party, the information of the party gets applied onto this gui


But I don’t know how to store the information or apply it

the script you’ve just shown for checking the password appears to be a local script. this means that any mildly competent exploiter can see the password for any server, which I assume is a big nono.

As for actual implementation, I’ve heard people using proxy servers and using the Roblox API or using Datastores (refreshing seems to be a pain though).

You don’t actually need to store password keys in proxy servers, you can make great use of DataStoreService or MemoryStoreService. MemoryStoreService would be great for this purpose.

I see the password checker on the client only checks whether the password is an empty string or not. So the checker is not a sercurity vulnerabilty.
However…
It is important as the server to not replicate the password towards the client though, which I partially can see being done in the second client script, PrivatePassword is replicated towards the client. That might cause a security vulnerability to possible exploiters if FireAllClients is used or FireClient is used on people who are not inside of the queue for that one game.

Edit:
As for storing the keys, you need an identifier for each key, this can be done using GenerateGUID.
For passwords, you should make random passwords as then you don’t have to filter it. (User Generated Content HAS to be filtered) Make sure to use a string of like 6 numbers or something like that, that way you don’t generate inappropriate words with text (which also HAS to be filtered). (If you have any interest into the rules around filtering, check out Text Filtering)

Ok, thanks for the suggestion. I changed the password from custom to random
image

But how would I prevent replicating the password? You are right, it is fire all clients (this is the server script)

game.ReplicatedStorage.ServerSignal_Server.OnServerEvent:Connect(function(Plr, ServerName, Private: boolean, Map: ValueBase, difficulty, PrivatePassword: string, creator: number)
	game.ReplicatedStorage.ServerSignal_Client:FireAllClients(ServerName, Private, Map, difficulty, PrivatePassword, creator)
end)

But it is this way because I don’t know any other way to do it,

Also, since the text is random, I am afraid there is the possibility that something inappropriate with be generated. Is there a way I can check if it’s filtered and reroll until it’s not? This is the function for creating a password (I know you can probably make it more efficient by not using a table and just using string split for a string to make the password but I was lazy)

From what I know, I would have to fire a remote event to check the filtering because it’s not allowed on the client.

local function createPassword(length)
	local password = ""
	for i = 1, length, 1 do
		local values = {"a", "b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A", "B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z",1,2,3,4,5,6,7,8,9,0}
		password = password..values[math.random(1, #values)]
	end
	return password
end

passwords don’t need to be unique.

If you really want createPassword to give good passwords I recommend not using math.random() to generate passwords - it’s deterministic and any hacker that has enough determination can reverse engineer it.

That said it might be a bit overkill since you’re not really storing any user data so it’s not the end of the world.

THAT SAID AGAIN, if one guy figures it out and spreads the method, everyone could go into any server.

Maybe figure out how to generate a unique seed and use that to generate a password. Just food for thought.

I would recommend not using random letters as filtering is just another extra step and might take unnecessary request budget. If you have a rate limit on requests towards the server, an exploiter won’t be able to simply brute force it that easily either. A 6 number password is fine.

That’s sought way too far. If that method was really effective you would see a lot of people cheating the system in games with lootboxes. It is true that randomness is non existent, but to generate similar results you need to be within the same environment.

1 Like

I’ll probably just use a dictionary

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.