Difference between revisions of "Lua:setXBox360ControllerVibration"
Jump to navigation
Jump to search
(Created page with 'Category:Lua '''function''' setXBox360ControllerVibration(''ControllerID'', ''leftMotor'', ''rightMotor'') Sets the speed of the left and right vibrating motor inside the co…') |
|||
| Line 1: | Line 1: | ||
[[Category:Lua]] | [[Category:Lua]] | ||
| − | '''function''' setXBox360ControllerVibration(''ControllerID'', ''leftMotor'', ''rightMotor'') | + | {{CodeBox|'''function''' setXBox360ControllerVibration(''ControllerID'', ''leftMotor'', ''rightMotor'') ''':''' void}} |
| − | Sets the speed of the left and right | + | Sets the vibration speed of the left and right motors inside the Xbox 360 controller. |
| − | + | The motor values range from 0 to 65535, where 0 disables the motor. | |
| − | {|width="85%" cellpadding="10 | + | ===Function Parameters=== |
| + | {|width="85%" cellpadding="10%" cellspacing="0" border="0" | ||
!align="left"|Parameter | !align="left"|Parameter | ||
!align="left"|Type | !align="left"|Type | ||
| Line 12: | Line 13: | ||
|- | |- | ||
|ControllerID | |ControllerID | ||
| − | | | + | |Integer |
| − | | | + | |The ID of the controller to set the vibration for. Valid values range from 0 to 3. |
|- | |- | ||
|leftMotor | |leftMotor | ||
| − | | | + | |Integer |
| − | |speed of the left motor | + | |The vibration speed of the left motor. The value ranges from 0 to 65535, where 0 is off. |
|- | |- | ||
|rightMotor | |rightMotor | ||
| − | | | + | |Integer |
| − | |speed of the right motor | + | |The vibration speed of the right motor. The value ranges from 0 to 65535, where 0 is off. |
|} | |} | ||
| + | ===Returns=== | ||
| + | void — This function does not return any value. | ||
| − | == | + | ===Examples=== |
| − | + | <pre> | |
| − | + | -- Set both vibration motors to full speed | |
| + | setXBox360ControllerVibration(0, 65535, 65535) | ||
| − | + | -- Stop both vibration motors | |
| − | + | setXBox360ControllerVibration(0, 0, 0) | |
| + | </pre> | ||
| + | |||
| + | {{LuaSeeAlso}} | ||
Latest revision as of 04:01, 21 June 2026
| <> Function function setXBox360ControllerVibration(ControllerID, leftMotor, rightMotor) : void |
Sets the vibration speed of the left and right motors inside the Xbox 360 controller.
The motor values range from 0 to 65535, where 0 disables the motor.
Function Parameters[edit]
| Parameter | Type | Description |
|---|---|---|
| ControllerID | Integer | The ID of the controller to set the vibration for. Valid values range from 0 to 3. |
| leftMotor | Integer | The vibration speed of the left motor. The value ranges from 0 to 65535, where 0 is off. |
| rightMotor | Integer | The vibration speed of the right motor. The value ranges from 0 to 65535, where 0 is off. |
Returns[edit]
void — This function does not return any value.
Examples[edit]
-- Set both vibration motors to full speed setXBox360ControllerVibration(0, 65535, 65535) -- Stop both vibration motors setXBox360ControllerVibration(0, 0, 0)
See also[edit]
| Lua |
| Script Engine |