Shoot player up in the air

Hello roblox
I want my code to send the player up in the air smoothly

--local script
local myPlayer = game.Players.LocalPlayer
local myChar = myPlayer.Character
local myHRP = myChar:WaitForChild("HumanoidRootPart")

for _ = 1, 2000, 1 do
	wait(0.0001)
	myHRP.Position = myHRP.Position + Vector3.new(0, 0, 0.001)
end 

this is what happens - YouTube

You should keep that itlooks great

EDIT: its not a bug its a feature amiright

i agree but my body geos bye byes

1 Like

Your script is messy, but to fix it change Z to Y:

local myPlayer = game.Players.LocalPlayer
local myChar = myPlayer.Character
local myHRP = myChar:WaitForChild("HumanoidRootPart")

for _ = 1, 2000, 1 do
	wait(0.0001)
	myHRP.Position = myHRP.Position + Vector3.new(0, 0.001, 0)
end 

well thanks but the Y axis wont do much will it?

You should really use one of the BodyMovers. They’re perfect for things like this, you can even tween their values

2 Likes

this will do the trick

local myPlayer = game.Players.LocalPlayer

local part = myPlayer.Character:WaitForChild("Humanoid")

local myChar = myPlayer.Character

local myHRP = myChar:WaitForChild("HumanoidRootPart")

local bodyForce = Instance.new("BodyForce")
bodyForce.Parent = myHRP
left = myHRP.Position + Vector3.new(0, 30, 0) * 200-- You could also use Vector3.FromNormalId(Enum.NormalId.Left)
bodyForce.Force = bodyForce.Parent.CFrame:vectorToWorldSpace(left)
wait(1)
bodyForce:Destroy()