Particle Scripting

Create Client.lua file in the Scripts folder and then input the text from the following code block.

Example: Creates a fire object using particles

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 function fireParticleUnitID(posx,posy,id) local p = ParticleSystem(); p.AttachToUnitID(Point(posx,posy),id) p.shape = 4 p.sortOrder = 499 p.material = 0 p.startLifetime = 1.5 p.startSpeed = 1 p.startSize = 25 p.gravityModifier = -10 p.angle = 50 p.radius = 7 p.shapeRotX = -90 p.shapeScaleZ = 13.5 p.scale = 3 p.sizeOverLifeTime = true p.sizeoVerLifeTimePrefab = 2 -- Particle Fire Setting p.colorOverLifeTime = true p.SetColorOverLifeTimeColor(0,Color(255,0,0,255)) p.RemoveColorOverLifeTimeColor(1); p.SetColorOverLifeTimeColorAlpha(0,0) p.AddColorOverLifeTimeAlpha(0.5,255) p.SetMaterialTexture("Pictures/fireEffect.png","Pictures/fireEffect.png") local p2 = ParticleSystem(); p.AddChild(p2) p2.visible = true p2.shape = 4 p2.sortOrder = 500 p2.material = 4 p2.startLifetime = 1.5 p2.startSpeed = 1 p2.startSize = 20 p2.gravityModifier = -10 p2.angle = 50 p2.scale = 3 p2.radius = 7 p2.shapeRotX = -90 p2.shapeScaleZ = 13.5 p2.sizeOverLifeTime = true p2.sizeoVerLifeTimePrefab = 2 -- Particle Fire Setting p2.colorOverLifeTime = true p2.SetColorOverLifeTimeColor(0,Color(255,255,0,255)) p2.RemoveColorOverLifeTimeColor(1); p2.SetColorOverLifeTimeColorAlpha(0,0) p2.AddColorOverLifeTimeAlpha(0.5,255) --Fire Effect Setting p2.SetMaterialTexture("Pictures/fireEffect.png","Pictures/fireEffect.png") end

Insert the code in the client script → Create an automatic start or button input event in Nekoland Studio → Register the script event → insert fireParticleUnitID(0,0, event.id).

Doing this will create a fire particle at the event location.

If you put unit.id instead of event.id, it will be created at the player's location. 0,0 indicates the location where the fire particle is to be created.