Why is this not updating for all players

Hello, I’m currently working on a script for people to request others to dual in-game, I’m working on just when a player joins, it is updated for the whole server and right now it’s only showing the local players name. Why is this?

This is a remote event if that is any help, if you are able to help, please explain what you are doing so I can learn

Script in ServerScriptService

local remote = game.ReplicatedStorage.Events.Game.DualUpdater

game.Players.PlayerAdded:Connect(function(player)
	
	remote:FireAllClients(player, "createPlayer")
	
	print("remote function fired to all clients")

end)

Localscript in the gui

local remote = game.ReplicatedStorage.Events.Game.DualUpdater

remote.OnClientEvent:Connect(function(player, result)
	if result == "createValue" then
		local gui = player:WaitForChild("PlayerGui")
		local contents = gui.Dual.Handler.Multiplayer.Contents
	
		local tab = contents.Sample:Clone()
		print("tab cloned")
		
		tab.Parent = contents.Players
		print("tab.Parent = Players")
		
		tab.Name = player.Name
		tab.Player.Text = "".. player.Name
		tab.Visible = true
		tab.Character.Text = "".. player.Equipped.Character.Value
		print("player file successfully set up!")
		
		tab.Player.MouseButton1Click:connect(function(sender)
			sendremote:FireServer(player, sender)
		end)
		
	end
end)

I believe this is because you’re editing the Player’s GUI that joined from the client side, thus it would only work for the local player as you can’t edit another’s GUI from the client.

So, how could I make this work as is intended?

i see that the result is createPlayer on the serverside but on the local side i only see createValue as the result no createPlayer or do you have another line for that?

My mistake, I was working on another script and I forgot to change both of them to “createPlayer”. They are both meant to be create player.

1 Like