How would I make it so when I press C to roll, for example when I would press C I would get a slight boost that pushes you forward. When you press the button a animation would also play. How would I also make a cooldown between each “roll”?
I already have the animation done for it. This game is also in R6
You will also want to look in to bodyVelocity, this will make your character move forward when they press the desired button and use UserInputService. This is how you would get C
UserInputService works great for getting keyboard actions. BodyVelocity
I don’t understand in the body velocity how it would push me forward or where it says it. And by looking do you mean where their mouse is or where their body is facing?
So I’ll show you a demo script(Read the notes, they will help you understand)
local RemoteEvent = game.ReplicatedStorage:WaitForChild("RemoteEvent")
local function Roll(Player) -- You would get the Player from firing of a remoteEvent
local Root = game.Player.Character:WaitForChild("HumanoidRootPart") -- Your Characters torso
local BV = instance.new("BodyVelocity") -- Making the Force
BV.MaxForce = Vector3.New(math.Huge, math.Huge, math.Huge) -- Don't worry about this
BV.Velocity = Root.CFrame.LookVector * 90 -- The number is the speed, LookVector gets where the part is facing
BV.Parent = Root -- Puts the force in the Torso
delay(0.5, function()
BV:Destroy() -- Removes Bv so character doesn't get pushed forever(aka. how long the dash is)
end)
end)
RemoteEvent.OnServerEvent:Connect(Roll) -- You have a remoteEvent fire from a local script(This will be where your UserInputService is at)