Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Question about infinite looping.. studio crashing?

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)

1 comment

0

It would be much better to only insert the object once and simply clone it afterwards.

1 answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.