Hierarchy http://image.prntscr.com/image/a8e4ccd44f474a3084980dd885a003cb.png
The problem is that the server script using the code I have doesn't update StringValues to players' names.
The result is always blank causing my local scripts to throw the error " is not a valid member of players"
while true do
wait(1)
players = game.Players:GetChildren()
for list = 1,3,1 do
num = tonumber(list)
if players[num]~=nil then
script.Parent:FindFirstChild(tostring(list)).User.Value = tostring(players[num].Name)
else
script.Parent:FindFirstChild(tostring(list)).User.Value = ""
end
end
end
This is the part of the local script that always breaks. FYI I am using FilteringEnabled.
local player1 = script.Parent:WaitForChild("User")
workspace.LHhandler.Update.OnClientEvent:connect(function()
if script.Parent.User.Value ~= "" then
script.Parent.Namee.Text = player1.Value
script.Parent.Wins.Text = game.Players[player1.Value].leaderstats.Wins.Value
end
----
