local player = game.Players.
LocalPlayer
if player.Name ~= "RekzyYT1" then return end
-- aabbaaii if u gona test put ur usser expect RekzyYT1
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local ContextActionService = game:GetService("ContextActionService")
local character = player.Character or player.CharacterAdded:Wait()
local hrp = character:WaitForChild("HumanoidRootPart")
local humanoid = character:WaitForChild("Humanoid")
local camera = workspace.CurrentCamera
humanoid.PlatformStand = true
local speed = 60
local ascend = false
local descend = false
local function onTouchAscend(actionName, inputState)
ascend = (inputState == Enum.UserInputState.Begin)
return Enum.ContextActionResult.Sink
end
local function onTouchDescend(actionName, inputState)
descend = (inputState == Enum.UserInputState.Begin)
return Enum.ContextActionResult.Sink
end
if UserInputService.TouchEnabled then
ContextActionService:BindAction("Ascend", onTouchAscend, false, Enum.K-
eyCode.ButtonR2, Enum.KeyCode.ButtonR1)
ContextActionService:BindAction("Descend", onTouchDescend, false,
Enum.KeyCode.ButtonL2, Enum.KeyCode.ButtonL1)
end
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.Space then
ascend = true
elseif input.KeyCode == Enum.KeyCode.LeftControl then
descend = true
end
end)
UserInputService.InputEnded:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.Space then
ascend = false
elseif input.KeyCode == Enum.KeyCode.LeftControl then
descend = false
end
end)
RunService.RenderStepped:Connect(function()
local camCFrame = camera.CFrame
local lookVector = camCFrame.LookVector
local moveDir = humanoid.MoveDirection
if moveDir.Magnitude > 0 then
local velocity = lookVector.Unit * speed
if ascend then
velocity = velocity + Vector3.new(0, speed, 0)
elseif descend then
velocity = velocity + Vector3.new(0, -speed, 0)
end
hrp.Velocity = velocity
local camX, camY = camCFrame:ToEulerAnglesXYZ()
hrp.CFrame = CFrame.new(hrp.Position) * CFrame.Angles(0, camY, 0) *
CFrame.Angles(camX, 0, 0)
else
hrp.Velocity = Vector3.new(0, 0, 0)
end
end)