I spent all day trying to figure out how I could make the code to allow the player to roll like in SwordBurst 2 (https://www.roblox.com/games/659222129) I know I have to use some kind of Body Mover, yet I don't know what does what or how to calculate what direction the player needs to move in.
I know how to use UserInputService so having it run when a key is pressed isn't a problem.
You need to use an animation to make the character roll. Make your own or take one.
A LocalScript is required for it to work.
local playerCharacter = game.Players.LocalPlayer.Character local humanoid = playerCharacter:WaitForChild("Humanoid") local anim = script.Animation --Change to animation location humanoid:LoadAnimation(anim):Play()
The playerCharacter variable stores the PlayerCharacter location. The humanoid variable stores the location of the character's humanoid. The anim variable stores the Animation's location. Change it to where your animation object is. (You need to insert an animation object in the workspace or as a child of ANYTHING and just make sure the script can locate it. Insert the animation's ID that you chose into the animation object and you're done. If you renamed your animation object to anything else then write the name of the animation object.) Finally, the last line tells the humanoid as you see the variable being called and the LoadAnimation function is also called. Into the parentheses of the LoadAnimation function, the anim variable's name is in it. Then, the Play() function well... plays the animation. Hope that helps.
Nevermind, I created a Shield effect to make my games PVP better, it works pretty good.