-- LUA Script - precede every function and global member with lowercase name of script + '_main' realsound_flag = 0 function realsound_init(e) end function realsound_main(e) PlayerDist = GetPlayerDistance(e) if PlayerDist<500 then if realsound_flag==0 then LoopSound(e,0) ActivateIfUsed(e) realsound_flag = 1 else SetSoundVolume(110-(PlayerDist/15)) end else StopSound(e) realsound_flag = 0 end end