setEffectColor
Shared
Tints an effect with a colour.
bool setEffectColor(effect effect, float r, float g, float b [, float a = 255])
Parameters
| Name | Type | Description |
|---|---|---|
| effect | effect | The effect. |
| r | float | Red, from 0 to 255. |
| g | float | Green, from 0 to 255. |
| b | float | Blue, from 0 to 255. |
| a | float | Alpha, from 0 to 255.default 255 |
Returns
true if it changed. false with a wrong argument (logs a warning).
Values outside 0 to 255 are clamped and rounded. On the server, the change reaches every client. On a client, changing an effect the server created only holds on this client until the server sends its state again.
Example
local smoke = createEffect("smoke_flare", 2495.1, -1687.4, 13.5)
setEffectColor(smoke, 80, 255, 120)