GetEffectScale

From Multi Theft Auto: Wiki

FROM VERSION 1.6 r7485 ONWARDS

This function returns the visible size of an effect.

Syntax

float getEffectScale ( effect theEffect )

OOP Syntax Help! I don't understand this!

Method: effect:getScale(...)
Variable: .scale
Counterpart: setEffectScale

Required Arguments

  • theEffect: the effect you wish to return the scale of.

Returns

  • A float indicating the scale of the effect, if successful.
  • false otherwise.

Example

Click to collapse [-]
Client

This example adds a command 'create_effect' which creates an effect with scale setted at 2 and prints its value.

addCommandHandler('create_effect',
	function()
		local x, y, z = getElementPosition(getLocalPlayer())
		local uEffect = createEffect('carwashspray', x, y, z+1) -- the effect was created
		setEffectScale(uEffect, 2) -- we set effect's scale to 2
		outputChatBox( string.format('Effect scale is %s !', getEffectScale(uEffect))) -- printing the result 
	end
)

See also