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

Help! My levitation script is lagging, because roblox's servers is lagging! How to fix it?

Asked by
Shaehl -11
6 years ago

I really don't know how to fix it. I tried a lot of things, don't work. Help me fix it!

My levitation script is lagging, because roblox's servers** is lagging! **Sometimes effect remains forever.

-- Levitate script

local can = false

function LoopCloneBody(part)
    while can do
        wait()
        if not part:findFirstChild("Screp") then
            local bV = script.BodyVelocity:Clone()
            bV.Parent = part
            bV.Name = "Screp"
            wait(1)
            bV:Destroy()
        end
    end
end

script.Parent.Touched:connect(function(hit)
    if not can then
        can = true
        LoopCloneBody(hit)
    end
end)
script.Parent.TouchEnded:connect(function(hit)
    can = false
end)
0
findFirstChild is not a method anymore, FindFirstChild is te new method. User#19524 175 — 6y
0
incapaz, you are seriously? What's the difference? Shaehl -11 — 6y
0
Use something that is not Roblox to fix your lag. hiimgoodpack 2009 — 6y

Answer this question