This is a serverscript in ServerScriptService? Can anyone help me?
game.Players.PlayerAdded:Connect(function(player)
workspace.ChildAdded:Connect(function(child)
local plr = game.Players:FindFirstChild(child.Name)
if child.Name == plr.Name then
wait()
local clone = script.Rank:Clone()
clone.Parent = workspace:FindFirstChild(plr.Name).Head
local rank = workspace:FindFirstChild(plr.Name.Head.Rank.Frame)
rank.Team.Text = plr.Team.Name
rank.Team.TextStrokeColor3 = plr.TeamColor.Color
rank.Name.Text = plr.Name
end
end)
end)
error is : attempt to index field 'Name' (a string value)

3 comments
player.Team is an instance, not a string, change it to player.Team.Name
Thank you!
np