local runs = game:GetService("RunService")
local Ip = game:GetService("Players").LocalPlayer
local character = Ip.Character or Ip.CharacterAdded:Wait()
local tweens = game:GetService("TweenService")
local humanoidRootPart = character and character:FindFirstChild("HumanoidRootPart")
-- Anti-fall functionality
local function setAntiFall(antiFall)
if character and character:FindFirstChild("Humanoid") then
local humanoid = character.Humanoid
if antiFall and humanoid:GetState() == Enum.HumanoidStateType.Freefall then
humanoidRootPart.Velocity = Vector3.new(0, 0, 0) --change to -0.01 if error
else
humanoidRootPart.Velocity = Vector3.new(0, 0, 0) -- Reset velocity when not anti-falling
end
end
end
local function tween(targetCFrame, speed)
if character and humanoidRootPart then
local distance = (humanoidRootPart.Position - targetCFrame.Position).Magnitude
local time = distance / speed
local tweeninfo = TweenInfo.new(time, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local start_tween = tweens:Create(humanoidRootPart, tweeninfo, { CFrame = targetCFrame })
start_tween:Play()
-- Enable anti-fall while tweening
local heartbeatConnection
heartbeatConnection = runs.Heartbeat:Connect(function()
setAntiFall(true) -- Enable anti-fall during tweening
end)
-- Wait for the tween to complete
start_tween.Completed:Wait()
-- Disable anti-fall after tween completion
setAntiFall(false)
-- Disconnect the heartbeat connection
heartbeatConnection:Disconnect()
return start_tween
end
end
local targetCFrame = CFrame.new() -- enter CFrame here
local speed = 300 -- Set the speed 150 - 350
tween(targetCFrame, speed)
To embed this project on your website, copy the following code and paste it into your website's HTML: