GUI Element created via server script doesn't show up locally?

I have a custom leaderboard that I’m working on, however I have a problem when moving things over to server scripts. It creates a new row to display the new players data, but that row only shows up on the client and not the server, so when I try to edit that information from the server it says it doesn’t exist. Does anyone know why???
Explorer:
image

Script:

function addplayer(value, isbac)

	local nameclone = script.Parent.ImageLabel.ScrollingFrame.TEMPLATE:Clone()
	nameclone.Parent = script.Parent.ImageLabel.ScrollingFrame
	nameclone.Name = value
	nameclone.TEMPLATENAME.Text = value
	nameclone.TEMPLATENAME.Name = value
	nameclone.Visible = true

	if players[nameclone.Name]:IsInGroup(ac) then

		nameclone.TEMPLATERANK.Text = players[value]:GetRoleInGroup(ac)

	end

	if players[nameclone.Name]:IsInGroup(ac) and players[nameclone.Name].Team ~= game.Teams.Bandits then

		nameclone.AC.Visible = true

	elseif players[nameclone.Name]:IsInGroup(gto) and players[nameclone.Name].Team ~= game.Teams.Assassins then

		nameclone.GTO.Visible = true

	end

	players[value]:GetPropertyChangedSignal("Team"):Connect(function()

		if players[value].Team == game.Teams.Assassins then

			nameclone[value].TextStrokeColor3 = Color3.new(0, 0.333333, 0.498039)

		elseif players[value].Team == game.Teams.Bandits then

			nameclone[value].TextStrokeColor3 = Color3.new(0.666667, 0, 0)

		elseif players[value].Team == game.Teams.Citizens then

			nameclone[value].TextStrokeColor3 = Color3.new(0.65098, 0.67451, 0.415686)

		end

	end)

end

players.PlayerAdded:Connect(function(player)

	addplayer(player.Name)

end)
2 Likes

Dont you have to create the frame on the Server Script? if you create an object on the client side it will only show to that client

1 Like

Creating the frame is already being done from a server script not a local script, that’s why I’m confused here.

1 Like

Thats weird, i tried replicating what you did there and is working for me

1 Like

Does it shows another error instead of “doesnt exist” one?

1 Like

It’s working for you? That’s extremely odd. It’s not for me, let me check for additional errors.

1 Like

No additional errors…

1 Like

What if you try placing the script on another place more than inside the player Gui?, like serverScriptService? (dam my grammar sucks)

1 Like

Anything in a client UI must be a local script…

1 Like

This isn’t true, plenty of ScreenGUIs work with server scripts inside of them. My Ninpo system is a good example of that.

1 Like

I ended up just scrapping the way I was doing it and trying another avenue. I ended up creating the UI elements from ServerScriptService into each replicated GUI instead. Sorry for the late reply!

2 Likes

That’s VERY bad practice, local scripts are meant for client UI not server scripts.

1 Like

? The local scripts don’t handle anything on the server, the server scripts do.

1 Like

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