how would I go about making a sliding system similiar to combat warriors slide system?
I’m currently in the process of learning how to script, so sorry if I’m not the best at understanding.
Not sure a sliding system would be a project for a beginner, but a sliding system would consist of:
- Animations
- Camera Manipulation
- And Body Movers
Step 1. make a local script
Step 2. put that local script in “StarterCharacterScripts”
Step 3. insert the following code:
local player = game:GetService(“Players”).LocalPlayer
local character = player.Character
local humanoid = character:WaitForChild(“Humanoid”)
local Animator = humanoid:WaitForChild(“Animator”)
local UIS = game:GetService(“UserInputService”)
local plr = game.Players.LocalPlayer.Character
UIS.InputBegan:Connect(function(input,GPE)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.LeftControl then
local JumpAnimation = Instance.new("Animation")
JumpAnimation.AnimationId = "rbxassetid://10488825251"
local asdf = Animator:loadAnimation(JumpAnimation)
asdf:Play()
UIS.InputEnded:Connect(function(input,GPE)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.LeftControl then
asdf:Stop()
UIS.InputEnded:Connect(function(input,GPE)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.Space then
asdf:Stop()
end end end)
end
end
end)
end
end
end)
I made an error in this script, but it doesn’t effect anything
BTW this will make you slide when you press left control
Also if you want the animation smoother then I can send you one
Dumping code to a beginner is not the best way for them to learn. The script you provided has sloppy variable names and has an animation id that he will not be able to use. If you want to give an answer go through your code and explain.
My apologies, I’m slightly new to scripting myself, the way I learn is by stealing code and using it so much that I memorize it. but I know enough that I can explain most of it.
sorry about the last code block, use this code instead:
local character = player.Character -- this is his physical form you can delete this line if you would like
local humanoid = character:WaitForChild("Humanoid") -- this is what makes the plaer a player
local Animator = humanoid:WaitForChild("Animator") -- this is what allows the player to walk and not fly
local UIS = game:GetService("UserInputService") -- this detects when a player presses a key
local plr = game.Players.LocalPlayer.Character -- this is his physical form, @Towphy was right about my code
UIS.InputBegan:Connect(function(input,GPE) -- if a key is pressed then
if input.UserInputType == Enum.UserInputType.Keyboard then -- if that is a key on a keyboard
if input.KeyCode == Enum.KeyCode.LeftControl then -- and if that key is Left Control then
local JumpAnimation = Instance.new("Animation") -- This puts a animation inside the humanoid (i think)
JumpAnimation.AnimationId = "rbxassetid://10488825251" -- that is the animation
local asdf = Animator:loadAnimation(JumpAnimation) -- gives a name to the animation
asdf:Play() -- plays the animation
UIS.InputEnded:Connect(function(input,GPE) -- if they stop pressing the key then
if input.UserInputType == Enum.UserInputType.Keyboard then -- if the key is on a keyboard
if input.KeyCode == Enum.KeyCode.LeftControl then -- and the key that they stopped pressing is Left Control then
asdf:Stop() -- the animation stops
-- sorry that the first one was poorly made
-- and this will only work on computers, it's the only way I know how to do this
end
end
end)
end
end
end) ```
in local script add a remoteevent which will fire this code
local vel = Instance.new(“BodyVelocity”,hrp)
vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
vel.Velocity = hrp.CFrame.lookVector* 60