Script 'CorePackages.Packages._Index.ExperienceChat-f36c98a4-90731c09.ExperienceChat.watchForErrors', Line 6

idk what is this message but it appeared when it runs this line of code:

function OnDied()
	Walk:Stop()
	Idle:Stop()
	Slime.Head.Sad.Transparency = 0
	Slime.Head.Happy.Transparency = 1
	Slime.HumanoidRootPart:Destroy()
	Slime.Animations:Destroy()
	Slime.Head.Anchored = true
	Slime.Head.Rumble.TimePosition = 3
	Slime.Head.Rumble:Play()
	local rotation = Slime.Head.Rotation
	for i=1, math.random(100,150) do
		Slime.Head.Rotation = rotation
		Slime.Head.Rotation = rotation + Vector3.new(math.random(-10,10), math.random(-10,10), math.random(-10,10))
		task.wait()
	end
	Slime.Head.Rumble:Stop()
	Slime.Head.ExplodeSound:Play()
	Slime.Head.Sad:Destroy()
	Slime.Head.Stats:Destroy()
	Slime.Head.Transparency = 1
	Slime.Head.CanCollide = false
	Slime.Head.ExplodeParticle.Color = ColorSequence.new(Slime.Head.Color)
	Slime.Head.ExplodeParticle.Enabled = true
	wait(0.5)
	Slime.Head.ExplodeParticle.Enabled = false
	wait(4)
	Slime:Destroy()
	SlimeModule.SpawnSlime(workspace.SlimeSpawn[Slime:GetAttribute("SpawnBiome")][Slime:GetAttribute("SpawnPart")], workspace.SlimeSpawn[Slime:GetAttribute("SpawnBiome")],  Slime.Name)
end

oh and here’s the output for more information

i need to fix it or my game will do bad with performance

ps: the WatchForErrors is a module and inside is empty

1 Like

This usually appears when there is a while true do loop with out an wait() or task.wait(). In this case something is causing the script run many times. Are you using any loops outside the code that you showed us? Also maybe try to use a different place just for a test.

1 Like

i think is the for i loop ill’ try to fix it

SOLVED IT

this:

	for i=1, math.random(100,150) do
		Slime.Head.Rotation = rotation
		Slime.Head.Rotation = rotation + Vector3.new(math.random(-10,10), math.random(-10,10), math.random(-10,10))
		task.wait()
	end

it was the task.wait()

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.