How do i script trading gui

So im trying to make it so the trading gui i made shows the everyone elses name except for the local player, because right now it shows everyone elses and the local player’s name

local function onPlayerAdded(player)
	local temp = tradingTemplate:Clone()
	temp.Parent = ParentFrame
	temp.Visible = true
	temp.playerName.Text = player.Name
	temp.Name = player.Name
end

You could do something like:

if GUI.Name == player.Name then
GUI.Visible = false

i tried that but that just destroyed all of the frames

I’m not sure why that would be the case unless the rest of your code is faulty.

You should actually do the if statement before you call the function meaning you would never have to create the GUI for the local player in the first place. You could do this by checking if it’s not the local player.

Try to blacklist their name.

if player.Name ~= localPlayer.Name then

end

what do you mean by that? The last sentence

As @rottendogDkR suggested you could implement an if statement that checks if it’s the local player or not. You could put this before you create any GUI buttons, that way the local player button doesn’t even exist for the local player.

like this?

local function onPlayerAdded(player)
	local gui = tradingTemplate:Clone()
	gui.Name = player.Name
	if player.Name ~= gui.Name then
		gui.Parent = ParentFrame
		gui.Visible = true
		gui.playerName.Text = player.Name
		gui.Name = player.Name
	end
end

That would probably work.

chars