Check out this video
Slightly editied script here, from small's great script.
Just made some small changes to jumpscare.lua, hope youe don't mind smallg
* added a light which emits when you enter the trigger zone, find the entity number of the dynamic light and enter that as the local variable ln
so if entity 6 is your light, just put local ln = 6
Place the light just in front and above the entity that will appear when you trigger the zone.
Looks great in a dark scene.
jumpscare2.lua
--script by smallg
local appearances = {}
local fade_delay = {}
local hidden = {}
local fade_delay_init = 0
local ln = 6 --Entity Number of the light (dynamic)
--set these to 0 if you dont want any movement from original location
--how far away from starting location entity can move in x axis
local movex_random = 15
--how far away from starting location entity can move in z axis
local movez_random = 20
function jumpscare2_init(e)
--how many times entity will appear
appearances[e] = math.random(2,2)
--how long between appearances (and how long it will appear for)
--is randomed so can be 25% shorter or longer (see near end of script)
fade_delay[e] = 100
---------------
hidden[e] = 1
CollisionOff(e)
fade_delay_init = fade_delay[e]
Hide(e)
HideLight(ln)
end
function jumpscare2_main(e)
RotateToPlayer(e)
CollisionOff(e)
if g_Entity[e]['activated'] == 1 then
if GetTimer(e) > fade_delay[e] then
if appearances[e] > 0 then
if hidden[e] == 1 then
PlaySound(e,1)
Show(e)
ShowLight(ln)
hidden[e] = 0
appearances[e] = appearances[e] - 1
else
Hide(e)
SetPosition(e,g_Entity[e]['x'] + math.random(-movex_random,movex_random),g_Entity[e]
['y'],g_Entity[e]['z']+math.random(-movez_random,movez_random))
hidden[e] = 1
end
else
if hidden[e] == 0 then
Hide(e)
HideLight(ln)
end
end
fade_delay[e] = GetTimer(e) + math.random(fade_delay_init * 0.75,fade_delay_init * 1.25)
end
end
end --main
function jumpscare_exit(e)
end