It works; it spawns a red light that fades after ten seconds.wagtunes wrote: ↑Sun May 23, 2021 1:52 amDoesn't do a thing.Code: Select all
function spawnLight() spawn("fx",1,self.x,self.y,1,"effect") effect:setLight(1,0,0,20,7,10,true) effect:translate(0,2,0) end
*This function uses the location of the script_entity itself as the spawn point... so to see it, you should position the script_entity within view of the party.
Also... This script has no check for existing names, and thus will crash the game if run twice (within ten seconds in this case), because it explicitly assigns the same name to every fx object that it creates; duplicate object names crash the game.
____________________________
The fx object is used to place particle & light effects.
Code: Select all
function spawnPoof()
local effect = spawn("fx",1,self.x,self.y,1)
if effect then
effect:setParticleSystem('blob')
effect:setLight(1,1,1,20,7,2,false)
effect:translate(0,1.5,0)
end
end