Scripts / Sound Zones on upper levels

Author
Message
thatandplaygames
4
Years of Service
User Offline
Joined: 12th Feb 2020
Location: In a creative space
Posted: 26th Apr 2022 17:44
I have a building with 2 levels. My sound zone is on the 2nd level but is triggered on the first level.

Thanks
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 26th Apr 2022 19:30 Edited at: 26th Apr 2022 20:29
Really? Still an issue this day and age? Thought had been modified some time ago.
But here's one to try;

-- LUA Script - precede every function and global member with lowercase name of script + '_main'
-- Player Enters Sound Zone

local plrtier = {}
function soundinzone_init(e)
plrtier[e] = 0
end
function soundinzone_main(e)
if g_Entity[e]['plrinzone'] == 1 then
plrtier[e] = g_PlayerPosY - GetEntityPositionY(e)
if plrtier[e] > 20 and plrtier[e] < 42 then
PlaySound(e,0)
Destroy(e)
ActivateIfUsed(e)
end -- plrtier
end
end -- main
PM
bluemeenie195
6
Years of Service
User Offline
Joined: 28th Oct 2018
Location:
Posted: 26th Apr 2022 21:46
Works good GubbyBlips.
Thank you
PM
thatandplaygames
4
Years of Service
User Offline
Joined: 12th Feb 2020
Location: In a creative space
Posted: 27th Apr 2022 01:34
Thanks, GubbyBlips...

Login to post a reply

Server time is: 2024-12-22 01:07:05
Your offset time is: 2024-12-22 01:07:05