Issues with studio, script editing results in an endless loop

Hi, I don’t use dev-forum often so I’m probably writing this in a wrong category.
I was working on my first slot car in roblox studio and I found this issue…

My issue: editing ANY script results in an infinite number of lines being created resulting in a freeze, this only happens when I edit the script, not when I open it or sellect a part of it. It started happening today or yesterday. It happens in any new place that I create. The weird thing is that my output says “maximum event re-entrancy depth exceeded for instance.sourcechanged”, wich means there’s for an example a function that is calling itself. That ends in an infinite loop. But nothing like this is actually happening so I don’t know what could be the issue.



I tried: restarting studio, restarting computer, geting rid of studio plugins that I recently instaled, turning off autocomplete in the settings.

I’m thinking about re-installing roblox studio.
I would appriciate any kind of help if you know what could resolve this issue.
Sorry for bad grammar, english isn’t my main language.

Well first of all there is an error in line 11, also why is there the plr variable in line 9

udead(plr.Character,plr)--The second plr is kinda redundant, what does it do?

In line 3, why would you clone the script, it will also trigger the same line over and over again, which will time out the game causing the error.

I wasn’t talking about that exact script. My issue is that I can’t edit scripts. Wich makes my whole roblox studio basicaly unusable. By this I mean that the issue happens everywhere, in every place, in every script, (it happens in every fresh new baseplate place that I create) I took a screen shot of that exact script just to demonstrate that it freezes when I do anything to it, I don’t even know what is that script supposed to do. Anyways thanks for help.

edit: I tried re-installing studio (didn’t help) the thing is actually generating these super long lines of some symbols, that’s probably why it’s so laggy. (I still have no idea what is going on and I don’t know how to fix it)

Firstly,
I believe there are better ways to check for this, you don’t even need to wait for the character.
I’ll provide an example below:


local Players = game:GetService('Players')
local Dead = script.Dead


local function PlayerAdded(Player)
	local function CharacterAdded(Character)
		local PlayerGui = Player:FindFirstChild('PlayerGui')
		if not PlayerGui then return end
		Dead:Clone().Parent = PlayerGui
	end
	
	-- If the player's character is added before the script runs
	if Player.Character then
		coroutine.resume(coroutine.create(function()
			CharacterAdded(Player.Character)
		end))
	end
	Player.CharacterAdded:Connect(CharacterAdded)
end


-- Get players that are in the game before the script runs
-- This code is just an example of how I would handle this.
local GetPlayers = Players:GetPlayers()
for i = 1, #GetPlayers do
	local Player = GetPlayers[i]
	coroutine.resume(coroutine.create(function()
		PlayerAdded(Player)
	end))
end
Players.PlayerAdded:Connect(PlayerAdded)

Secondly,
You should consider to add a Humanoid.Died event as that will trigger once a player dies. CharacterAdded runs when the player’s character is added to workspace.

He dont want to fix the script, read the topic again

1 Like

exactly, the problem is my studio not working, not the script, that was just an example

1 Like

Try to re-install your studio and clear your cache. Perhaps something’s keeping it from completing certain tasks within studio.

I did both and sadly nothing changed

It works now, I don’t even know how I fixed it. it might have been by clicking the “what’s new” button. Kinda ironic. I’m so happy right now

thats really weird, i just started having that issue today to
i wonder if some update broke studio or something

That’s possible, if you still have this problem, I suggest reinstalling studio, disabling studio plugins, clearing cache, restarting your computer. I still don’t know what could be causing this issue tho :confused:.

I’ve been having this same exact problem on and off for months now. It’s doing it right now, unfortunately.

This happens with me also… I recently found another thing which crashes studio. Suppose you want to cut and paste some stuff from one Roblox file to another Roblox file. You copy the stuff from 2nd file. Now, if you paste that stuff in 1st file after closing the 2nd file, it hangs forever. It seems that it keeps waiting for the source which now doesn’t exist.