Getting extreme lags while my stand disappearing

So when i press Q my stand disappear but the problem is that when it disappear my screen getting freezed until stand will fully disappear, how can i fix it?

local RS = game:GetService("ReplicatedStorage")
local ADEvent = RS:WaitForChild("StandAppearDisappear")
local UserInputService = game:GetService("UserInputService")

local function Disappear(player, DaBounce)
	if DaBounce == false and game.Workspace:WaitForChild(player.Name).Stand.StandName.Value == "HierophantGreenSeugo" then
		for i, v in pairs(game.Workspace:FindFirstChild(player.Name).Stand:GetChildren()) do
			repeat
				v.Transparency = v.Transparency + 0.5
			until v.Transparency == 1
		end
	end
end

ADEvent.OnServerEvent:Connect(Disappear)

I’m assuming you want a faded disappearance…

In the function Disappear, I added a wait function to give it time to add a fade. I have not tested this yet so I’m not sure if this will work or not…

…repeat
v.Transparency = v.Transparency + 0.01
wait(-math.huge)
until v.transparency = 1…

1 Like

i dont know why but now it’s not even disappearing for some reason