getEffectSpeed | Multi Theft Auto: Wiki Skip to content

getEffectSpeed

Client-side
Server-side
Shared

Pair: setEffectSpeed

Manual Review Required

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


This function gets the speed of a specified effect.

OOP Syntax Help! I don't understand this!

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

Syntax

float getEffectSpeed ( effect theEffect )
Required Arguments
  • theEffect: The effect to get the speed of.

Returns

  • float: value

Returns float containing the effect's speed, false if invalid arguments were specified.

Code Examples

shared

This example adds commandgesthat creates crate explosion effect at the player's position and outputs its speed to the chatbox.

addCommandHandler("ges",
function (cmd)
local x, y, z = getElementPosition(localPlayer)
local effect = createEffect("explosion_crate", x, y, z)
outputChatBox("The speed: " .. tostring(getEffectSpeed(effect)))
end)