Run it
Copy the script and paste it into your executor.
Players = :()
RunService = :()
UserInputService = :()
player = Players.LocalPlayer
gui = player:()
character = player.Character player.CharacterAdded:()
humanoid = character:()
root = character:()
jumpAnim = .()
jumpAnim.AnimationId =
jumpAnimTrack = humanoid:(jumpAnim)
scriptEnabled =
spaceHeld =
velocity = .()
isGrounded =
wasGrounded =
moveDir = .()
footstepTimer =
footstepInterval =
lastFootstepIndex =
cfg = {
groundAccel = ,
airAccel = ,
maxAirSpeed = ,
runSpeed = ,
jumpPower = ,
gravity = ,
friction = ,
stopSpeed = ,
}
rocketBlastRadius =
footstepSounds = {
,
,
,
,
}
jumpSound = .(, root)
jumpSound.SoundId =
jumpSound.Volume =
jumpSound.PlaybackSpeed =
landSound = .(, root)
landSound.SoundId =
landSound.Volume =
landSound.PlaybackSpeed =
()
sound = .(, )
lastFootstepIndex = lastFootstepIndex +
lastFootstepIndex > #footstepSounds
lastFootstepIndex =
sound.SoundId = footstepSounds[lastFootstepIndex]
sound.Volume =
sound.PlaybackSpeed = + .(-, ) /
sound:()
:():(sound, )
()
jumpSound
jumpSound:()
jumpSound:()
jumpAnimTrack
jumpAnimTrack:()
()
landSound
landSound:()
landSound:()
jumpAnimTrack
jumpAnimTrack:()
isMobile = UserInputService.TouchEnabled UserInputService.KeyboardEnabled
gameModes = {}
isMobile
gameModes = {, , }
gameModes = {, , }
currentModeIndex =
()
g = .(, gui)
g.ResetOnSpawn =
g.Name =
destroy = .(, g)
destroy.Size = .(, , , )
destroy.Position = .(, , , -)
destroy.BackgroundColor3 = .(, , )
destroy.Text =
destroy.MouseButton1Click:(()
humanoid.WalkSpeed =
humanoid.JumpPower =
g:()
scriptEnabled =
:()
)
toggle = .(, g)
toggle.Size = .(, , , )
toggle.Position = .(, , , -)
toggle.BackgroundColor3 = .(, , )
toggle.Text =
toggle.MouseButton1Click:(()
scriptEnabled = scriptEnabled
toggle.Text = scriptEnabled
toggle.BackgroundColor3 = scriptEnabled .(, , ) .(, , )
)
modeButton = .(, g)
modeButton.Size = .(, , , )
modeButton.Position = .(, , , -)
modeButton.BackgroundColor3 = .(, , )
modeButton.Text = .. gameModes[currentModeIndex]
modeButton.TextScaled =
modeButton.MouseButton1Click:(()
currentModeIndex = currentModeIndex +
currentModeIndex > #gameModes currentModeIndex =
modeButton.Text = .. gameModes[currentModeIndex]
)
isMobile
jumpButton = .(, g)
jumpButton.Size = .(, , , )
jumpButton.Position = .(, -, , -)
jumpButton.Text =
jumpButton.Name =
jumpButton.MouseButton1Down:(() spaceHeld = )
jumpButton.MouseButton1Up:(() spaceHeld = )
()
()
rayParams = RaycastParams.()
rayParams.FilterDescendantsInstances = {character}
rayParams.FilterType = .RaycastFilterType.Exclude
result = :(root.Position, .(, -, ), rayParams)
(result result.Instance result.Instance.CanCollide)
(dt)
speed = velocity.Magnitude
speed < velocity = .()
drop = isGrounded (.(speed, cfg.stopSpeed) * cfg.friction * dt)
newSpeed = .(speed - drop, )
newSpeed ~= speed velocity = velocity * (newSpeed / speed)
(wishDir, wishSpeed, accel, dt)
cur = velocity:(wishDir)
add = wishSpeed - cur
add <=
accelSpeed = .(accel * dt * wishSpeed, add)
velocity = velocity + wishDir * accelSpeed
(dt)
scriptEnabled
humanoid.WalkSpeed =
humanoid.JumpPower =
wasGrounded = isGrounded
isGrounded = ()
isGrounded wasGrounded
()
footstepTimer =
cam = .CurrentCamera
fwd = cam.CFrame.LookVector
right = cam.CFrame.RightVector
fwd = .(fwd.X, , fwd.Z).Unit
right = .(right.X, , right.Z).Unit
input = .()
isMobile
input = humanoid.MoveDirection
UserInputService:(.KeyCode.W) input += fwd
UserInputService:(.KeyCode.S) input -= fwd
UserInputService:(.KeyCode.A) input -= right
UserInputService:(.KeyCode.D) input += right
input.Magnitude > input = input.Unit
isGrounded
(dt)
(input, cfg.runSpeed, cfg.groundAccel, dt)
input.Magnitude >
footstepTimer += dt
footstepTimer >= footstepInterval
()
footstepTimer =
spaceHeld
velocity = .(velocity.X, cfg.jumpPower, velocity.Z)
()
velocity = .(velocity.X, , velocity.Z)
(input, cfg.maxAirSpeed, cfg.airAccel, dt)
velocity += .(, -cfg.gravity * dt, )
root.AssemblyLinearVelocity = velocity
UserInputService.InputBegan:((i)
i.KeyCode == .KeyCode.Space spaceHeld =
)
UserInputService.InputEnded:((i)
i.KeyCode == .KeyCode.Space spaceHeld =
)
RunService.Heartbeat:((dt)
humanoid humanoid.Health > (dt)
)
player.CharacterAdded:((char)
character = char
humanoid = char:()
root = char:()
jumpAnimTrack = humanoid:(jumpAnim)
)
()
use shiftlock for a better experience ok