Why does this script cause roblox studio to not respond?

I am making a system and when I try to test it, Studio doesn’t respond or “crashes”. However, when I disable the script everything is fine. Why does the script cause roblox to crash? Here is the script:

local TS = game:GetService("TweenService")
local ti = TweenInfo.new(4,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
local tween4 = TS:Create(script.Parent.Handle,ti,{Orientation = Vector3.new(0,360,0)})
tween4:Play()
tween4.Completed:Connect(function()
	script.Parent.Handle.Orientation = Vector3.new(0,0,0)
	tween4:Play()
end)

Sorry, I put the wrong script. I’ll replace it now

When the tween is completed, it’ll paly the tween again, and then again, and so on infintely. If you’re trying to make an infinite tween, can’t change the 4th paramerter of TweenInfo to -1 so it tweens infinitely?

local ti = TweenInfo.new(4,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,-1,false,0)

So it would look something like this?

local TS = game:GetService("TweenService")
local ti = TweenInfo.new(4,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,-1,false,0)
local tween4 = TS:Create(script.Parent.Handle,ti,{Orientation = Vector3.new(0,360,0)})
tween4:Play()
tween4.Completed:Connect(function()
	script.Parent.Handle.Orientation = Vector3.new(0,0,0)
end)

If it still happens, you may need to add a wait to your code instead