local part=script.Parent for i=1,50 do part.Position=part.Position+Vector3.new(0,0,3) wait(0.3) end
If you mean as if its levitating up and down then I recommend to try this (i havent tested it lol)
local part = script.Parent while wait() do for i = 1, 200 do wait(i/1800) part.Position = part.Position + Vector3.new(0,.025,0) if i == 100 then break end end for i = 1, 200 do wait(i/1800) part.Position = part.Position + Vector3.new(0,-.025,0) if i == 100 then break end end end
MultipleHeadshots is wrong, you must use CFrame:
part = script.Parent while true do for i = 1, 200 do wait(0.1) part.Position.CFrame = CFrame.new(part.Position + Vector3.new(0,.2,0)) if i == 100 then break end end for i = 1, 200 do wait(0.1) part.Position.CFrame = CFrame.new(part.Position + Vector3.new(0,-.2,0)) break end end end
Using CFrame + Vector3 performs the slide because the CFrame constructor is adjusting the Part's Position so that it levitates. Without CFrame the levitation would look really blocky. (And, MultipleHeadshots, just for the credit, local variables were deprecated so that the are only usable within their native code block. This happened 3 years ago when Roblox upgraded to Lua 5.1.)