Ok, so I understand functions, but I don't understand the parameter part when you put:
local function onInputChanged(input, gameProcessed)
if input.UserInputType = Enum.UserInputType.MouseMovement then
print("The mouse has been moved!")
printMovement(input)
end
Yes, isn't input and gameProcessed not defined?
Why do you put On when you do that?
Why doesn't this script work, but worked before when I used it
How come some values in parameters have a value while others do not.
local function PlayerAdded(player)
Isn't player not defined?
Some part in there, you put
player.Character
How can you define the character of the player in the parameter if the value of the player is not defined?
it's just in the function PlayerAdded()
Relatively, the same thing for local function(input, GameProccessed)
Is Gameprocessed or input even defined does it have a value at all?
How then does it work the script
game:GetService("UserInputService").InputBegan:connect(function(Action1)
if Enum.KeyCode.R then
print("R was pressed")
end
local function onInputChanged(input,gameProcessed)
if input.UserInputType == Enum.UserInputType.MouseMovement then
print("The mouse has been moved!")
printMovement(input)
elseif input.UserInputType == Enum.UserInputType.MouseWheel then
print("The mouse wheel has been scrolled!")
print("\tWheel Movement:",input.Position.Z)
elseif input.UserInputType == Enum.UserInputType.Gamepad1 then
if input.KeyCode == Enum.KeyCode.Thumbstick1 then
print("The left thumbstick has been moved!")
printMovement(input)
elseif input.KeyCode == Enum.KeyCode.Thumbstick2 then
print("The right thumbstick has been moved!")
printMovement(input)
elseif input.KeyCode == Enum.KeyCode.ButtonL2 then
print("The pressure being applied to the left trigger has changed!")
print("\tPressure:",input.Position.Z)
elseif input.KeyCode == Enum.KeyCode.ButtonR2 then
print("The pressure being applied to the right trigger has changed!")
print("\tPressure:",input.Position.Z)
end
elseif input.UserInputType == Enum.UserInputType.Touch then
print("The user's finger is moving on the screen!")
printMovement(input)
elseif input.UserInputType == Enum.UserInputType.Gyro then
local rotInput,rotCFrame = UserInputService:GetDeviceRotation()
local rotX,rotY,rotZ = rotCFrame:toEulerAnglesXYZ()
local rot = Vector3.new(math.deg(rotX),math.deg(rotY),math.deg(rotZ))
print("The rotation of the user's mobile device has been changed!")
print("\tPosition",rotCFrame.p)
print("\tRotation:",rot)
elseif input.UserInputType == Enum.UserInputType.Accelerometer then
print("The acceleration of the user's mobile device has been changed!")
printMovement(input)
end
end
UserInputService.InputChanged:connect(onInputChanged)

2 comments
Just a tip for next time: be mindful of the syntax highlighter for code blocks, and other markdown options. It helps organize your question, and in doing so, helps the people reading it.
Edited for formatting.