Hey!
I’m experiencing extremely severe lag when trying to join the game I’m developing to test it on Roblox Studio, and I’ve finally found the script that’s causing the lag after disabling many of them. The script is provided below; the lag that it causes is so severe that it makes my Roblox Studio crash. Let me know if anyone knows why the script is causing this issue and if there’s any way of fixing it; any and all help is appreciated. Thank you.
local Gui = script.Parent
local tweenInfo = TweenInfo.new(5)
local h = true
local tween1 = game:GetService("TweenService"):Create(Gui, tweenInfo,{Rotation = (-5)})
local tween2 = game:GetService("TweenService"):Create(Gui, tweenInfo,{Rotation = (5)})
while h == true do
tween1:Play()
tween1.Completed:Connect(function()
tween2:Play()
end)
tween2.Completed:Connect(function()
tween1:Play()
end)
end