#Im not sure how to make a shift to slide script
110 messages · Page 1 of 1 (latest)
With a boolvalue, If your running set it to true, not set it to false. Then when you crouch it will slide or crouch depending on if your running.
send the script i'll wrap it up and explain it to you aswell
There all in different folders
send me sprinting, crouching and sliding scripts
unless you have like 20 scripts split up for the codes
local UIS = game:GetService("UserInputService")
local char = script.Parent
local slideAnim = Instance.new("Animation")
slideAnim.AnimationId = "rbxassetid://139682445589811" --
local keybind = Enum.KeyCode.LeftControl --
local canslide = true
UIS.InputBegan:Connect(function(input,gameprocessed)
if gameprocessed then return end
if not canslide then return end
if input.KeyCode == keybind then
canslide = false
local playAnim = char.Humanoid:LoadAnimation(slideAnim)
playAnim:Play()
local slide = Instance.new("BodyVelocity")
slide.MaxForce = Vector3.new(1,0,1) * 30000
slide.Velocity = char.HumanoidRootPart.CFrame.lookVector * 100
slide.Parent = char.HumanoidRootPart
for count = 1, 8 do
wait(0.1)
slide.Velocity*= 0.7
end
playAnim:Stop()
slide:Destroy()
canslide = true
end
end)
slide
local UIS = game:GetService("UserInputService")
local char = script.Parent
local slideAnim = Instance.new("Animation")
slideAnim.AnimationId = "rbxassetid://139682445589811" --
local keybind = Enum.KeyCode.LeftControl --
local canslide = true
UIS.InputBegan:Connect(function(input,gameprocessed)
if gameprocessed then return end
if not canslide then return end
if input.KeyCode == keybind then
canslide = false
local playAnim = char.Humanoid:LoadAnimation(slideAnim)
playAnim:Play()
local slide = Instance.new("BodyVelocity")
slide.MaxForce = Vector3.new(1,0,1) * 30000
slide.Velocity = char.HumanoidRootPart.CFrame.lookVector * 100
slide.Parent = char.HumanoidRootPart
for count = 1, 8 do
wait(0.1)
slide.Velocity*= 0.7
end
playAnim:Stop()
slide:Destroy()
canslide = true
end
end)
crpuch
sprint?
local UIS = game:GetService('UserInputService')
local Player = game.Players.LocalPlayer
local Character = Player.Character
UIS.InputBegan:connect(function(input)--
if input.KeyCode == Enum.KeyCode.LeftShift then
Character.Humanoid.WalkSpeed = 26
local Anim = Instance.new('Animation')
Anim.AnimationId = 'rbxassetid://9040323497'
PlayAnim = Character.Humanoid:LoadAnimation(Anim)
PlayAnim:Play()
end
end)
UIS.InputEnded:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
Character.Humanoid.WalkSpeed = 16
PlayAnim:Stop()
end
end)
sorry
alright give me some time
Take as much time as you need
sliding ~
local UIS = game:GetService("UserInputService")
local char = script.Parent
local Humanoid = char:FindFirstChildOfClass("Humanoid")
local Animator = Humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", Humanoid)
local slideKey = Enum.KeyCode.LeftControl
local canSlide = true
UIS.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if not canSlide or not _G.isSprinting then return end
if input.KeyCode == slideKey then
canSlide = false
local slideAnim = Instance.new("Animation")
slideAnim.AnimationId = "rbxassetid://139682445589811"
local playAnim = Animator:LoadAnimation(slideAnim)
playAnim:Play()
local slide = Instance.new("BodyVelocity")
slide.MaxForce = Vector3.new(1,0,1) * 30000
slide.Velocity = char.HumanoidRootPart.CFrame.lookVector * 100
slide.Parent = char.HumanoidRootPart
for count = 1, 8 do
wait(0.1)
slide.Velocity *= 0.7
end
playAnim:Stop()
slide:Destroy()
canSlide = true
end
end)```
# crouching ~
```lua
local UIS = game:GetService("UserInputService")
local char = script.Parent
local Humanoid = char:FindFirstChildOfClass("Humanoid")
local Animator = Humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", Humanoid)
local crouchKey = Enum.KeyCode.LeftControl
local canCrouch = true
UIS.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if not canCrouch or _G.isSprinting then return end
if input.KeyCode == crouchKey then
canCrouch = false
local crouchAnim = Instance.new("Animation")
crouchAnim.AnimationId = "rbxassetid://139682445589811"
local playAnim = Animator:LoadAnimation(crouchAnim)
playAnim:Play()
wait(0.5)
playAnim:Stop()
canCrouch = true
end
end)```
# sprinting ~
```lua
local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local isSprinting = false
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
local Animator = Humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", Humanoid)
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
isSprinting = true
_G.isSprinting = true
Humanoid.WalkSpeed = 26
local sprintAnim = Instance.new("Animation")
sprintAnim.AnimationId = "rbxassetid://9040323497"
local PlayAnim = Animator:LoadAnimation(sprintAnim)
PlayAnim:Play()
end
end)
UIS.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
isSprinting = false
_G.isSprinting = false
Humanoid.WalkSpeed = 16
for _, anim in pairs(Animator:GetPlayingAnimationTracks()) do
anim:Stop()
end
end
end)```
small explanation ~ i fixed the animations by using an animator so they don’t break sprinting disables crouching to avoid weird movement sliding only works while sprinting to make it feel smooth animations stop properly so nothing stacks or bugs out
if you don't understand any parts of the code feel free to ask or if something doesn't work
it only needed couple of lines to add and change ^
uh let me fix 1 or 2 mistakes one sec
there @bronze marsh give it a try
i used an animator to play animations so they work right used a global sprinting variable to control crouching and sliding also used input detection to check when to start or stop actions and body velocity to make sliding feel real
(if it doesn't work i'll kms)
bruh
leme check
not from what i see crouching just dosent seem to work
hmm
whenever i try to crouch it starts a slide but puts me right back up
alright we can fix the crouching just show me a clip so i understand whats the issue
yea gimme a min
yeayea
sorry i gotat relaunch medal for me to take a clip
np
wait leme insert the animations again that may be why
possibly
you can spoof
ima check that rq and see if that fixes it
ill send a clip if that dosent chaneg anything
alright
Watch Roblox Studio and millions of other Roblox Studio videos captured using Medal.
dose this help?
so
frist part is me trying crouch then walk
second part is me trying walk the crouch
Watch Roblox Studio and millions of other Roblox Studio videos captured using Medal.
allso whenever i slide
it adds my run animation into it top
Watch Roblox Studio and millions of other Roblox Studio videos captured using Medal.
allso whenever i dont hit ctrl while slideing it forces me into a stiff pose
SORRY IM VERY THANKFULL FOR ALL THE HELP
I DONT WANA SOUND LIKE A BITCH COMPLAING
😭
@tepid sigil
ALLSO YOU DONT HAVE TO FIX IT
lemme finish my game and ill take a look
OKOK
HOW
studio settings
wheree
oookay let me
whoops
get to the typing
nah bro ima try
@bronze marsh is it okay if i separate walking and idle crouch
cuz that way it'll use anims properly
you'll just have to make or find a crouch walk animation
silence means yes
amazing
sprint
local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
local Animator = Humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", Humanoid)
local isSprinting = false
local sprintAnim
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift and not _G.isCrouching then
isSprinting = true
_G.isSprinting = true
Humanoid.WalkSpeed = 26
if not sprintAnim then
sprintAnim = Instance.new("Animation")
sprintAnim.AnimationId = "rbxassetid://9040323497"
end
local playAnim = Animator:LoadAnimation(sprintAnim)
playAnim:Play()
end
end)
UIS.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
isSprinting = false
_G.isSprinting = false
Humanoid.WalkSpeed = _G.isCrouching and 8 or 16
for _, anim in pairs(Animator:GetPlayingAnimationTracks()) do
anim:Stop()
end
end
end)```
# crouch with walk and idle bozo
```lua
local UIS = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local char = script.Parent
local Humanoid = char:FindFirstChildOfClass("Humanoid")
local Animator = Humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", Humanoid)
local isCrouching = false
local crouchIdleAnim
local crouchWalkAnim
local playingCrouchAnim
UIS.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed or _G.isSprinting then return end
if input.KeyCode == Enum.KeyCode.LeftControl then
isCrouching = not isCrouching
_G.isCrouching = isCrouching
Humanoid.WalkSpeed = isCrouching and 8 or 16
if not crouchIdleAnim then
crouchIdleAnim = Instance.new("Animation")
crouchIdleAnim.AnimationId = "rbxassetid://YO_CROUCH_IDLE_NUDES" -- yes bozo put it here
end
if not crouchWalkAnim then
crouchWalkAnim = Instance.new("Animation")
crouchWalkAnim.AnimationId = "rbxassetid://YO_CROUCH_WALK_ANIMATION" -- yes bozo put it here
end
if playingCrouchAnim then
playingCrouchAnim:Stop()
end
playingCrouchAnim = Animator:LoadAnimation(crouchIdleAnim)
playingCrouchAnim:Play()
end
end)
RunService.RenderStepped:Connect(function()
if isCrouching then
local velocity = Humanoid.MoveDirection.Magnitude
if velocity > 0 then
if playingCrouchAnim then playingCrouchAnim:Stop() end
playingCrouchAnim = Animator:LoadAnimation(crouchWalkAnim)
playingCrouchAnim:Play()
else
if playingCrouchAnim then playingCrouchAnim:Stop() end
playingCrouchAnim = Animator:LoadAnimation(crouchIdleAnim)
playingCrouchAnim:Play()
end
end
end)```
slide into yo booty 
local UIS = game:GetService("UserInputService")
local char = script.Parent
local Humanoid = char:FindFirstChildOfClass("Humanoid")
local Animator = Humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", Humanoid)
local canSlide = true
local slideAnim
UIS.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed or not _G.isSprinting or not canSlide then return end
if input.KeyCode == Enum.KeyCode.LeftControl then
canSlide = false
_G.isSprinting = false
Humanoid.WalkSpeed = 10
if not slideAnim then
slideAnim = Instance.new("Animation")
slideAnim.AnimationId = "rbxassetid://139682445589811"
end
local playAnim = Animator:LoadAnimation(slideAnim)
playAnim:Play()
local slide = Instance.new("BodyVelocity")
slide.MaxForce = Vector3.new(1,0,1) * 30000
slide.Velocity = char.HumanoidRootPart.CFrame.lookVector * 100
slide.Parent = char.HumanoidRootPart
for count = 1, 8 do
wait(0.1)
slide.Velocity *= 0.7
end
playAnim:Stop()
slide:Destroy()
Humanoid.WalkSpeed = 16
_G.isSprinting = false
canSlide = true
end
end)```
i'm lazy to explain
just try
don't forget to put crouch animations
OK OK LEME LAUNCH STUDIO
we;;
well
crouching is bugged again
i think
it works betetr then last time
here if you wnat too try again if not i get that but like
here if you do hop in vc
ill screen share
crouch
local UIS = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local char = script.Parent
local Humanoid = char:FindFirstChildOfClass("Humanoid")
local Animator = Humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", Humanoid)
local isCrouching = false
local crouchIdleAnim
local crouchWalkAnim
local playingCrouchAnim
UIS.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed or _G.isSprinting then return end
if input.KeyCode == Enum.KeyCode.LeftControl then
isCrouching = not isCrouching
_G.isCrouching = isCrouching
Humanoid.WalkSpeed = isCrouching and 8 or 16
if not crouchIdleAnim then
crouchIdleAnim = Instance.new("Animation")
crouchIdleAnim.AnimationId = "rbxassetid://idle"
end
if not crouchWalkAnim then
crouchWalkAnim = Instance.new("Animation")
crouchWalkAnim.AnimationId = "rbxassetid://walk"
end
if playingCrouchAnim then
playingCrouchAnim:Stop()
end
playingCrouchAnim = Animator:LoadAnimation(crouchIdleAnim)
playingCrouchAnim:Play()
end
end)
RunService.RenderStepped:Connect(function()
if isCrouching then
local velocity = Humanoid.MoveDirection.Magnitude
if velocity > 0 and playingCrouchAnim ~= crouchWalkAnim then
if playingCrouchAnim then playingCrouchAnim:Stop() end
playingCrouchAnim = Animator:LoadAnimation(crouchWalkAnim)
playingCrouchAnim:Play()
elseif velocity == 0 and playingCrouchAnim ~= crouchIdleAnim then
if playingCrouchAnim then playingCrouchAnim:Stop() end
playingCrouchAnim = Animator:LoadAnimation(crouchIdleAnim)
playingCrouchAnim:Play()
end
end
end)```
# slide
```lua
local UIS = game:GetService("UserInputService")
local char = script.Parent
local Humanoid = char:FindFirstChildOfClass("Humanoid")
local Animator = Humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", Humanoid)
local canSlide = true
local slideAnim
local slidePlaying = false
UIS.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed or not _G.isSprinting or not canSlide then return end
if input.KeyCode == Enum.KeyCode.LeftControl then
canSlide = false
_G.isSprinting = false
Humanoid.WalkSpeed = 10
slidePlaying = true
if not slideAnim then
slideAnim = Instance.new("Animation")
slideAnim.AnimationId = "rbxassetid://139682445589811"
end
for _, anim in pairs(Animator:GetPlayingAnimationTracks()) do
anim:Stop()
end
local playAnim = Animator:LoadAnimation(slideAnim)
playAnim:Play()
local slide = Instance.new("BodyVelocity")
slide.MaxForce = Vector3.new(1,0,1) * 30000
slide.Velocity = char.HumanoidRootPart.CFrame.lookVector * 100
slide.Parent = char.HumanoidRootPart
for count = 1, 8 do
wait(0.1)
slide.Velocity *= 0.7
end
playAnim:Stop()
slide:Destroy()
Humanoid.WalkSpeed = 16
_G.isSprinting = false
canSlide = true
slidePlaying = false
end
end)```
sprint
local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
local Animator = Humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", Humanoid)
local isSprinting = false
local sprintAnim
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift and not _G.isCrouching and not _G.slidePlaying then
isSprinting = true
_G.isSprinting = true
Humanoid.WalkSpeed = 26
if not sprintAnim then
sprintAnim = Instance.new("Animation")
sprintAnim.AnimationId = "rbxassetid://9040323497"
end
for _, anim in pairs(Animator:GetPlayingAnimationTracks()) do
anim:Stop()
end
local playAnim = Animator:LoadAnimation(sprintAnim)
playAnim:Play()
end
end)
UIS.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
isSprinting = false
_G.isSprinting = false
Humanoid.WalkSpeed = _G.isCrouching and 8 or 16
for _, anim in pairs(Animator:GetPlayingAnimationTracks()) do
anim:Stop()
end
end
end)```
add " at the end
forgot what its called
@bronze marsh
i'll send the plugin here and an asset here
asset in dms*
hold on
@bronze marsh https://create.roblox.com/store/asset/2537608092 get this plugin