you cant spawn lights but you can hide & show them via your own script
-you need an entity to use as a fire
-apply the sound to sound slot 0
-place a light underneath it (adjust the range as required)
-insert the entity number of the light into my script
campfire.lua
--camp fire script by smallg
--how far away player can be to use the fire
local use_range = 200
--entity number of light to use for fire
local lightnumber = 2
--set to 0 or 1 (fire off/on)
local fire_lit = 0
local pressed = 0
local mapload = 0
function campfire_init(e)
end
function campfire_main(e)
if GetPlayerDistance(e) <= use_range then
if fire_lit == 0 then
PromptLocal(e,"Press E to light fire")
else
PromptLocal(e,"Press E to extinguish fire")
end
if g_KeyPressE == 1 and pressed == 0 then
pressed = 1
if fire_lit == 0 then
StartParticleEmitter(e)
ShowLight(lightnumber)
LoopSound(e,0)
fire_lit = 1
else
StopParticleEmitter(e)
HideLight(lightnumber)
StopSound(e,0)
fire_lit = 0
end
end
end
if g_KeyPressE == 0 and pressed == 1 then
pressed = 0
end
--check initial state of fire
if mapload == 0 then
if fire_lit == 0 then
HideLight(lightnumber)
else
StartParticleEmitter(e)
ShowLight(lightnumber)
LoopSound(e,0)
end
mapload = 1
end
--
end --main
life's one big game
windows vista ultimate
i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11