I have a server script that is meant to change the text of a textlabel to a players username, everything works fine, and the script is doing what it’s supposed to, in the properties of the textlabel, the text has changed to the players username but the physical gui on the screen won’t change. Why is that?
local ct = game.ReplicatedStorage:WaitForChild("ChangeTeam")
local Menu = game.StarterGui.Menu
ct.OnServerEvent:Connect(function(player, change)
print(change.Name)
if game.Teams:FindFirstChild(change.Name) then
local TeamNum = Menu:WaitForChild(change.Name)
local Count = TeamNum:WaitForChild("Value")
local User1 = TeamNum:WaitForChild("Username 1")
local User2 = TeamNum:WaitForChild("Username 2")
local User3 = TeamNum:WaitForChild("Username 3")
Count.Value = Count.Value+1
player.Team = game.Teams:FindFirstChild(change.Name)
if User1.Text == "Username" then
User1.Text = player.Name
print("User1 Changed")
elseif User2.Text == "Username" then
User2.Text = player.Name
print("User2 Changed")
else
User3.Text = player.name
print("User3 Changed")
end
end
end)