ah good point, that's an oversight on my part because you can't move zones so it wont work directly with a zone, you need a real entity, if you need it to be a zone you will need to modify the script to include the zone number
i.e. assign it to an entity as normal and then where you replaced the zone check use the actual entity number of the zone instead of 'e'
like
*where 2 is the zone number*
--script by smallg
--how long to shake camera for
local duration = 500
--how far down camera can move in 1 update
local vertical_low = -5
--how far up camera can move in 1 update
local vertical_high = 5
--how far left camera can move in 1 update
local horizontal_low = -5
--how far right camera can move in 1 update
local horizontal_high = 5
local x = 0
local y = 0
local state = ""
function shake_camera_init(e)
CollisionOff(e)
Hide(e)
end
function shake_camera_main(e)
--change number here to entity number of your zone
if GetPlayerInZone(2) == 1 then
state = "shake"
end
if state == "shake" then
if x < duration then
SetPosition(e,g_PlayerPosX,g_Entity[e]['y']-g_PlayerPosY+600,g_PlayerPosZ)
SetRotation(e,g_PlayerAngX-math.random(vertical_low,vertical_high),g_PlayerAngY+math.random(horizontal_low,horizontal_high),g_PlayerAngZ)
if y >= 5 then
TransportToIfUsed(e)
y = 0
else
y = y + 1
end
x = x + 1
else
--if you want shake to stop after the duration ends but player is still in the zone then uncomment the Destroy(e)
--or if he can re-enter the zone without triggering the shake etc
--Destroy(e)
x = 0
y = 0
state = ""
end
end
end --main
function shake_camera_exit(e)
end
life\'s one big game
windows vista ultimate
i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11