Basically.
I use Humanoid:MoveTo() and the player moves to that position. But I want to illustrate the keys it would be pressing.
So if I like press W, it moves forward. But as I said I use Humanoid:MoveTo(). I want it to print the keys it would be pressing.
MoveTo(10,10,10)
What key’s would I press, or hold, to go to that position in workspace.
This is confusing
To make it clear I’m using pathfinding service, and I’m in a car. I cant move the humanoid because it would not move the car. So somehow I have to translate the movement to keys. Dont give me it like
’ ooh you should put a function in the car ooh use this method which is not related at all to this ’
Yo man. I have to translate the player moving to a point in keys. So like to move to vector3 10, 10, 10
I lets say would have to hold W and A to go that way.
Alright, so if you’re getting this from a player and you want to know what direction they’re moving in, you can use Humanoid.MoveDirection. You will have to translate this into keys somehow.
game:GetService("UserInputService").InputBegan:Connect(function(key, gp)
if key.KeyCode == Enum.KeyCode.W and not gp then
--do what you do
end
end)
game:GetService("UserInputService").InputEnded:Connect(function(key, gp)
if key.KeyCode == Enum.KeyCode.W and not gp then
--do what you do i guess again and prevent the began function from running
end
end)
you can repeat these functions and do what’s left up to you