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)

3 comments

0

findFirstChild is not a method anymore, FindFirstChild is te new method.

0

incapaz, you are seriously? What's the difference?

0

Use something that is not Roblox to fix your lag.