Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Insane lag while opening GUI?

Asked by
3F1VE 257 Moderation Voter
3 years ago
Edited 3 years ago

Heres the code :

local frame = script.Parent.Parent.Parent.Parent.SettingsFrame
script.Parent.Activated:Connect(function()
    if frame.Visible == false then
        frame.Visible = true
        script.Parent.TextColor3 = Color3.fromRGB(0,0,0)
        script.Parent.Parent.BackgroundColor3 = Color3.fromRGB(255,255,255)
        local tweeninfo = TweenInfo.new(.5,Enum.EasingStyle.Sine,Enum.EasingDirection.Out)
        local tween = game.TweenService:Create(frame,tweeninfo,{Size = UDim2.new(0.197, 0,0.575, 0)})
        tween:Play()
    else 
        script.Parent.TextColor3 = Color3.fromRGB(255,255,255)
        script.Parent.Parent.BackgroundColor3 = Color3.fromRGB(0,0,0)
        local tweeninfo = TweenInfo.new(.5,Enum.EasingStyle.Sine,Enum.EasingDirection.Out)
        local tween = game.TweenService:Create(frame,tweeninfo,{Size = UDim2.new(0,0,0,0)})
        tween:Play()
        tween.Completed:Connect(function()frame.Visible =false end)
    end
end)

When I open the GUI it causes immense lag and spikes my Send packets which lags my wi-fi. The GUI is a basic settings UI. I have a high end laptop too.

0
This also happens while scrolling through it. 3F1VE 257 — 3y
0
If it lags while scrolling, i think it might just be what you have on the gui or a different script. that script looks fine. Might lag less if its a local script but it shouldn't be that noticeable. Are there any other scripts that use up a lot of memory in the console or you just have a lot on the ui? BulletproofVast 1033 — 3y
0
It definitely could be the event is activating too much, or like bullet said, other scripts might be on a never ending loop CrypxticDoge 135 — 3y
0
Its on activate. 3F1VE 257 — 3y
0
Well the lag is fixed somehow. But the ping still spikes up to 1 megabyte send 3F1VE 257 — 3y

Answer this question