GetProjectileForce

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This function returns the force of the specified projectile.

Syntax

float getProjectileForce ( projectile theProjectile )

OOP Syntax Help! I don't understand this!

Method: projectile:getForce(...)
Variable: .force


Required Arguments

  • theProjectile: The projectile element which force you want to retrieve.

Returns

Returns a float if successful, false otherwise.

Example

Example 1: This example would outputs the force of the projectile on 1-100 scale. This function just works with projectiles which you throw so just grenades, satchel charge etc


addEventHandler("onClientProjectileCreation", getRootElement(),
--The source of this event is the projectile that was created.
function ()
    local getForce = getProjectileForce(source)
    outputChatBox(getForce*100) -- outputs the force of the projectile on 1-100 scale
end
)

See also