Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Making a player "Roll" six studs?

Asked by 5 years ago
Edited 5 years ago

I have a script, and its supposed to make the player's character move by six studs. And, I am soon going have an animation to this(if this script works), this is to simulate "Rolling."

Here's the script

local Plr = game:GetService("Players").LocalPlayer
local Mouse = Plr:GetMouse()

Mouse.KeyDown:connect(function(key)
    key = key:lower()
    if key == "r" then
        print("R has been pressed!")
        local Character = Plr.Character
        local RootPart = Character.HumanoidRootPart
        RootPart.CFrame = RootPart.Position + CFrame.new(0,0,6)
    end
end)

And, don't please judge I'm using the mouse, its the only way I know how to use key down. Thanks

0
Well, i dont know the answer, but i think i know how to make key r activate it. You just need Enum.Keycode.R. Im just not entirely sure how it works fighterkirbyzx 102 — 5y
0
wild revolvers ripoff TheluaBanana 946 — 5y
0
I am not ripping off wild revolvers, its for an entirely different game! CaptainGalexyCreeper 15 — 5y

Answer this question