If I add a wait to this script, it doesn't work. Am I not putting it in the right place? I was thinking about adding a while wait but I don't know where to place it, can somebody help me out because right now it crashes my studio every time I run it because of the "end)" it's infinitely looping without a wait
game.Players.PlayerAdded:connect(function(player) local PLAYERFILE = Instance.new("IntValue") PLAYERFILE.Name = player.Name local PLAYN = player.Name PLAYERFILE.Parent = game.ServerScriptService.PlayerFiles wait(1) do game:GetService("InsertService"):LoadAsset(747089665).Parent = game.ServerScriptService.PlayerFiles:FindFirstChild(player.Name) end end)
I'd try putting the wait here instead :
game.Players.PlayerAdded:connect(function(player) local PLAYERFILE = Instance.new("IntValue") PLAYERFILE.Name = player.Name local PLAYN = player.Name PLAYERFILE.Parent = game.ServerScriptService.PlayerFiles do game:GetService("InsertService"):LoadAsset(747089665).Parent = game.ServerScriptService.PlayerFiles:FindFirstChild(player.Name) wait(1) end end)