Hello everyone, good morning (or afternoon if your in a different time zone) and today I have a serious question that came up in my head.
Literally, how do you move the position of your character on the X,Y, and Z axis similar to how you would do it for a brick?
Lately I have been going into the keyDown stuff, and even though im a complete novice towards scripting and probably shouldn't be doing this kind of advanced stuff, I like to experiment.
My ultimate goal is to make a script that once your press a certain key on the keyboard, it sends your character moving in different positions, as you are about to see in the code I will show you.
player = game.Players.LocalPlayer tool = script.Parent tool.Equipped:connect(function(mouse) mouse.KeyDown:connect(function(key) if key == "h" then print("You pressed h") else print("Try again and press h") end end) end)
That was my first attempt at doing anything with keyDown, and it is pretty basic.
You Cframe the character to a new area.
player = game.Players.LocalPlayer local mouse = player:GetMouse() tool = script.Parent tool.Equipped:connect(function() mouse.KeyDown:connect(function(key) if key == "h" then player.Character:MoveTo(mouse.Hit) print("You pressed h") else print("Try again and press h") end end) end)
I believe that's how it goes... Maybe not... Hope this helped, I'm sort of new to key's as well however I'm familiar with the moving of a character.