Y = 0 local ds = game:GetService("DataStoreService"):GetDataStore("ToolSt6yy67yyyyqadryyyaayyyyyyyyyyyve") game.Players.PlayerAdded:connect(function(plr) inventoryGUI = game.ReplicatedStorage.Inventory:Clone() inventoryGUI.Parent = plr.PlayerGui lol = Instance.new("Folder", plr) lol.Name = "leaderstats" lol.Parent = plr pcall(function() local tools = ds:GetAsync(plr.UserId) print(tools) if tools then for i,v in pairs(tools) do local tool = game.ReplicatedStorage.Values:FindFirstChild(v) if tool then plr:WaitForChild("leaderstats") tool:Clone().Parent = plr.leaderstats print(tool) wait() Text = Instance.new("TextLabel") Text.TextSize = 30 Text.TextColor3 = Color3.new(255, 0, 0) Y = Y + 0.2 Text.Text = tool.Name Text.Parent = plr.PlayerGui.Inventory.Frame Text.Position = UDim2.new(0.5, 0, Y, 0) end end end end) end) game.Players.PlayerRemoving:connect(function(plr) toolsToSave = { } pcall(function() for i,v in pairs(plr.leaderstats:GetChildren()) do if v then table.insert(toolsToSave,v.Name) print(v.Name) end end ds:SetAsync(plr.UserId,toolsToSave) end) end) game.ReplicatedStorage.AwardItem.OnServerEvent:connect(function(player, Item) print(player) print(Item) PlayerName = player ItemNew = Instance.new("IntValue") ItemNew.Name = Item ItemNew.Parent = game.Players[player.Name].leaderstats end)
The problem is, when someone joins the game, it loads everything properly. But the next person that joins does not get the text of what skins they have. That means only the first peroson can see it properly. How would I fix this?