GetEffectSpeed: Difference between revisions
Jump to navigation
Jump to search
(Added OOP syntax) |
mNo edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
{{New items| | {{New items|3.014|1.4 r6208| | ||
This function gets the speed of a specified [[effect]]. | This function gets the speed of a specified [[effect]]. | ||
}} | }} | ||
Line 19: | Line 19: | ||
===Example=== | ===Example=== | ||
This example adds command ''ges'' that creates crate explosion effect at the player's position and outputs its speed to the chatbox. | This example adds command ''ges'' that creates crate explosion effect at the player's position and outputs its speed to the chatbox. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addCommandHandler("ges", | addCommandHandler("ges", | ||
function (cmd) | function (cmd) |
Latest revision as of 13:55, 7 May 2017
This function gets the speed of a specified effect.
Syntax
float getEffectSpeed ( effect theEffect )
OOP Syntax Help! I don't understand this!
- Method: effect:getSpeed(...)
- Variable: .speed
- Counterpart: setEffectSpeed
Required Arguments
- theEffect: The effect to get the speed of.
Returns
Returns float containing the effect's speed, false if invalid arguments were specified.
Example
This example adds command ges that 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)