Hey there,
So i am currently having trouble with a script and would appreciate some assistance.
The problem is that a script is not changing the text contained within a text box and i get this output error:
attempt to index string with 'Text
The script is contained within a Local Script, the script is here:
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
local template = script:WaitForChild("PlayerUsername")
local scroller = script.Parent:WaitForChild("LeaderboardScroller")
function playerUpdate()
for i, v in pairs(scroller:GetChildren()) do
if v:IsA("Frame") then v:Destroy() end
end
for i, plr in pairs(game.Players:GetPlayers()) do
local templateClone = template:Clone()
templateClone.Name.Text = plr.Name -- The error occurs here
templateClone.Parent = scroller
scroller.CanvasSize = UDim2.new(0,0,0, scroller.UIListLayout.AbsoluteContentSize.Y)
end
end
playerUpdate()
game.Players.PlayerAdded:Connect(playerUpdate)
game.Players.PlayerRemoving:Connect(playerUpdate)
Im not too sure as to why this is happening since it has worked previously in other scripts.
Thank You! 