setEffectSpeed | Multi Theft Auto: Wiki Skip to content

setEffectSpeed

Client-side
Server-side
Shared

Pair: getEffectSpeed

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function sets the speed of a specified effect.

OOP Syntax Help! I don't understand this!

  • Method: effect:setSpeed(...)
  • Variable: .speed

Syntax

bool setEffectSpeed ( effect theEffect, float speed )
Required Arguments
  • theEffect: The effect to change the speed of.
  • speed: The speed to set.

Returns

  • bool: value

Returns true if the effect speed was succesfuly changed, false otherwise.

Code Examples

shared

This example adds commandsesthat creates effect of a smoke at player's position and sets its speed to 5.

addCommandHandler("ses",
function (cmd)
local x, y, z = getElementPosition(localPlayer)
local effect = createEffect("smoke30lit", x, y, z)
setEffectSpeed(effect, 5)
end)