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
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.
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.
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