Scripting sending / forcing user / player input commands , like move forward

Hello all scripting wizards,

Is there a way of controlling a player via just sending / controlling, the user input.

So there are easy ways of getting user input

`local UserInputService = game:GetService(“UserInputService”)

local Kinput = false
local Iinput = false

UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.UserInputType == Enum.UserInputType.Keyboard then

	if input.KeyCode == Enum.KeyCode.K then -- reverse
		Kinput = true

blah blah

etc , but instead of reading it, actually sending the key stoke and other normal scripts are listening and doing what is then read by the players input.

Easy example, user via their controls, make it PC to keep it simple presses W and goes forward, things happen …

Can we script it, so we are sending W keystrokes, (Not scripting movement on the players, but just controlling the user input)

Thanks, and thoughts, or script example would be sweet.

To control player input, you need to replace Roblox’s movement system with your own. With Roblox’s default movement modules though, this is not possible.

1 Like

ok, so as a start, how do I get the default movement scripts and then tweak them?

Like kick off a game in studio and then copy a script in play mode?

So for example you wanna make if a player press a certain key the player walks instead of pressing the default key “w”, see I don’t think this is possible. But you can make a player run or jump using a different key it doesn’t have to be default roblox keys. Like for example when a player press “J” the player jumps, etc.

Correct. Find them in Player Scripts.