====== Particles Class (Special Effect) ======
Class For Particles Interface
[[developer_center:developer_editor:script|Return To Previous Page]]
------
**[[developer_center:developer_editor:particleid|List Of Particle ID]]**
==== How to Write Event =====
ScriptSupportEvent:registerEvent([[EventName]],callbackFunctionName)
==== Example ====
function EffectsOnCreature (e)
local objectID = e.eventobjid
local effectID = e.effectid
local x,y,z = e.x,e.y,e.z
end
ScriptSupportEvent:registerEvent([[Particle.Mob.OnCreate]],EffectsOnCreature)
===== Event List =====
^ Event Name ^ Parameters ^ Description ^
| Particle.Mob.OnCreate | eventobjid, effectid, x, y, z | Triggers when effects are created on any creature. Parameters: Event creature, special effect type, block position |
| Particle.Player.OnCreate | eventobjid, effectid, x, y, z | Triggers when effects are created on any player. Parameters: Event player, special effect type, block position |
| Particle.Pos.OnCreate | effectid, x, y, z | Triggers when effects are created at any position. Parameters: Special effect type, block position |
| Particle.Projectile.OnCreate | eventobjid, effectid, x, y, z | Triggers when any projectile effect is created. Parameters: Event thrower, special effect type, block position |
===== Api List =====
The Api List Grouped Based on it Class
==== World Class ====
Particles in World Class is Based on it Location
^ Class:apiName(parameters) ^ Return ^ Descriptionn ^
| World:playParticalEffect(x: number, y: number, z: number, particleId: number, scale: number) | code: number | Play a particle effect at the specified position |
| World:stopEffectOnPosition(x: number, y: number, z: number, particleId: number) | code: number | Stop a particle effect at the specified position |
| World:setEffectScaleOnPosition(x: number, y: number, z: number, particleId: number, scale: number) | code: number | Set the scale of a particle effect at the specified position |
| World:randomParticleEffectID() | code: number, result: number | Randomly get a particle effect ID |
| World:playSoundEffectOnPos(pos: table, soundId: number, volume: number, pitch: number, isLoop: boolean) | code: number | Play a sound effect at the specified position |
| World:stopSoundEffectOnPos(pos: table, soundId: number) | code: number | Stop a sound effect at the specified position |
==== Actor Class ====
^ Class:apiName(parameters) ^ Return ^ Descriptionn ^
| Actor:playBodyEffectById(objid:number, particleId:number, scale:number) | ErrorCode.OK | The main function of this method: play special effects on the specified player |
| Actor:stopBodyEffectById(objid:number, particleId:number) | ErrorCode.OK | The main function of this method: stop the special effects on the specified player |
| Actor:setBodyEffectScale(objid:number, particleId:number, scale:number) | ErrorCode.OK | The main function of this method: set the size of the special effect on the specified player |
| Actor:playSoundEffectById(objid:number, soundId:number, volume:number, pitch:number, isLoop:bool) | ErrorCode.OK | The main function of this method: play sound effects on the specified Actor |
| Actor:stopSoundEffectById(objid:number, soundId:number) | ErrorCode.OK | The main function of this method: stop the sound effect on the specified Actor |