Help with script

th

2 Likes

The problem you’re facing is that the while loop blocks the code, this meaning that any code written under a “while true do” loop won’t run

This happens because the script will run the loop over and over again thus never reaching the code underneath

A simple solution would be to put the loop at the end so it won’t block any other lines to be run

2 Likes

Another solution is to put the loop in a thread, but since there’s only 1 loop(not 2 or 3 at once), I think it’s ideal to just put the loop at the end. However, this is the alternative thread solution:

game.Players.PlayerAdded:Connect(function(plr)
	task.spawn(function()
		while task.wait(1) do
			--loop code
		end
	end)
	--your .Changed connections
end)
1 Like

Yes but I kept it simple and clear how to fix the issiue

2 Likes