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

3 comments

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

0

wild revolvers ripoff

0

I am not ripping off wild revolvers, its for an entirely different game!