Skip to main content

CharacterAttachedEffect

CharacterAttachedEffect holds the visual effects the game attaches to a character's body: the near-death screen effect, catching fire, splashing water, snow falling off, wingsuit trails, hoverboard effects and more. Use it to play one of them on a player.

Available on: Client

Values​

CharacterAttachedEffect​

Used by player:PlayAttachedEffect(effect, restartIfPlaying) (client): plays the effect on that player's character, if it is spawned in the local game (the call does nothing otherwise). restartIfPlaying restarts the effect when it is already playing. The effect is only played in the local game; it is not synced to other players.

Several effects come in parts the game normally plays in sequence (NearDeathEnter / NearDeathLoop / NearDeathExit, AREffectEnter / AREffectExit). Play the parts in the same order.

NameValueMeaning
CharacterAttachedEffect.AREffectEnter0x17A48Start of the AR (augmented reality scan) effect.
CharacterAttachedEffect.AREffectExit0x17A49End of the AR (augmented reality scan) effect.
CharacterAttachedEffect.Concussion0x17A4AConcussion effect (hit by a concussion blast).
CharacterAttachedEffect.NearDeathEnter0x17A4BStart of the near-death effect (very low health).
CharacterAttachedEffect.NearDeathExit0x17A4CEnd of the near-death effect.
CharacterAttachedEffect.NearDeathLoop0x17A4DThe looping part of the near-death effect.
CharacterAttachedEffect.Died0x17A4EDeath effect.
CharacterAttachedEffect.RemoveSnow0x17A4FSnow falling off the character.
CharacterAttachedEffect.Wingsuiting0x17A50Effect while flying the wingsuit.
CharacterAttachedEffect.Stunting0x17A51Effect while on a stunt position.
CharacterAttachedEffect.Hoverboard0x17A52Effect while riding the hoverboard.
CharacterAttachedEffect.Magrail0x17A53Effect while grinding a magnetic rail.
CharacterAttachedEffect.GetOffHoverboard0x17A54Getting off the hoverboard.
CharacterAttachedEffect.HoverboardJump0x17A55Jumping with the hoverboard.
CharacterAttachedEffect.HoverboardLand0x17A56Landing with the hoverboard.
CharacterAttachedEffect.HoverboardPushOff0x17A57Pushing off with the hoverboard.
CharacterAttachedEffect.HoverboardBump0x17A58The hoverboard bumping into something.
CharacterAttachedEffect.Persistent0x17A59The character's persistent (always on) effect.
CharacterAttachedEffect.Underwater0x17A5AEffect while underwater (bubbles).
CharacterAttachedEffect.Parachuting0x17A5BEffect while under the parachute.
CharacterAttachedEffect.Swimming0x17A5CEffect while swimming.
CharacterAttachedEffect.Freefalling0x17A5DEffect while freefalling.
CharacterAttachedEffect.GrappleCharge0x17A5EThe grapple charging up.
CharacterAttachedEffect.WaterSplash0x17A5FA water splash.
CharacterAttachedEffect.EvadeLand0x17A60Landing from an evade (dodge roll).
CharacterAttachedEffect.Fire0x17A61The character is on fire.
CharacterAttachedEffect.Melee0x17A62A melee hit.
CharacterAttachedEffect.Gib0x17A63Gibbing (a violent death effect).
CharacterAttachedEffect.BulletDamage0x17A64Hit by a bullet.
CharacterAttachedEffect.HeavyBulletDamage0x17A65Hit by a heavy bullet.

Example

-- client: when the server says a player was hit by a flamethrower, set them on fire in this game
Net.AddEvent("playerBurned", function(net_id)
local object = World.GetObjectByNID(net_id)
local player = object and object:AsPlayer()

if player then
player:PlayAttachedEffect(CharacterAttachedEffect.Fire, true)
end
end)