local snd
local trigger
local playerWasInTrigger = false
local soundPlayed = false
function init()
    snd = LoadSound("MOD/snd/Sunup/737.ogg")
    trigger = FindTrigger("T")
end
function tick(dt)
    local playerPos = GetPlayerTransform().pos
    local isInTrigger = IsPointInTrigger(trigger, playerPos)
    if isInTrigger and not playerWasInTrigger and not soundPlayed then
        PlaySound(snd, playerPos, 200.0)
        soundPlayed = true
    end
    playerWasInTrigger = isInTrigger
end