-- LUA Script - precede every function and global member with lowercase name of script + '_main' realsound_flag = 0 last_zone = 0 local vol_mod = 25 --how quickly the sound volume changes based on distance to centre of zone (lower value = quicker) function realsound1_init(e) end function realsound1_main(e) if g_Entity[e]['plrinzone'] == 1 then last_zone = e elseif last_zone == e then last_zone = 0 realsound_flag = 0 end if last_zone == e then if realsound_flag==0 then LoopSound(e,0) ActivateIfUsed(e) realsound_flag = 1 else SetSoundVolume(100-(GetPlayerDistance(e)/vol_mod)) end else StopSound(e) end end