Help with making a invite player list system

Hello developers!

I need some help. I am making a system something like the leaderboard but with a Invite button. Here’s how is supposed to work.

Player Joins the server → Create a new frame → PS Owner presses Invite → Do stuff

Now my problem is in the “Private Server Owner presses Invite

I originally thought that I could use a Local Script that was a child of the Frame that I was copying and the script would run. But it didn’t. I can’t find a way to make this work. Feel free give ideas!

Ok, I don’t think you are able to use a local script for that, try with a server one, also how were you able to create this strange buttons? Just courious
Edit: I was able to figure out

It’s a Gui so I don’t think I should use a Server Script. Every time a player joins the Owner/Admin’s player list adds that player, and they can invite them. Can you explain your idea of using a server script?
An image of Gui

I think that to get what you need you can’t use the local script because it is local, meaning it reads only what the player sees, so you would need a server script to get when the player joins etc. Did you get what I mean now?

The joining part work completely fine it’s the part that is actual pressing Invite button that I can’t get work. I could only get it to work on my self which is bad. I was using ChildedAdded Event but I can’t use a MouseClick event inside of the Function

Users.ChildAdded:Connect(function(Child)
	
	print("Child added")
	
	if Child:IsA("Frame") then
		
		print("Child is a frame")
		
	end
end)

Are you using ChilAdded on the Players? If yes then you shouldn’t, the documentation says that using Instance.ChildAdded for the Players service isn’t how you use it, you have to use Players.PlayerAdded

I do use Players.PlayerAdded in my code, but I thought I could use ChildAdded to find the button and some how use MouseButton1Click. Cleary I could not get that to work. I’m working on the button because after I copy the frame my code doesn’t work when I try to find and check if the Invite button was clicked.

The message

I thought I could use the script after copying. I can’t

You can use SocialService to invite users of all ages that are friends on the same account using a LocalScript.