Hi! So I’ve scripted a hide players button but when there is a server with about 50 players and every one of them presses it, they get massive Frame Drops.
Code: (I think the full code is not necessary)
textButton.MouseButton1Click:Connect(function()
if isInvisible == false then
isInvisible = true
--Make them invisible
pcall(function() runService:UnbindFromRenderStep("UnInvis") end)
runService:BindToRenderStep("Invis", Enum.RenderPriority.Camera.Value - 10, changeTransparencyTo1)
for i = 1, isInvisText:len() do
wait()
textButton.Text = isInvisText:sub(1, i)
end
It’s probably because I’m binding it to RenderStepped and when 50 people activate this, then it gets pretty laggy. Any ideas on how to “fix” this?