UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Trigger a sound struct when entering a doorway?

broken avatar :(
Created 10 years ago
by Megadeth9811
0 Members and 1 Guest are viewing this topic.
1,553 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 23 February 2014
Last active: 7 years ago
Posts
143
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
-Mega \m/
Signature
Trve Kvlt Black Metal
×
Megadeth9811's Groups
Megadeth9811's Contact & Social LinksMegadeth9811Megadeth9811Megadeth9811
I want to make a trigger where if any player enters a room with a trigger_multiple over it, a song plays.

I tried writing a script here, but without any luck:

Code Snippet
Plaintext
function music_1()
{
    trig_1 = GetEnt("music_trig_1", "targetname");
song_1 = struct::get("music_struct_1", "targetname");

trig_1 SetHintString("");
trig_1 SetCursorHint("HINT_NOICON");

trig_1 waittill("trigger", player);
song_1 PlayLocalSound("mus_trigger_1");

trig_1 Delete();

}

How can I do this correctly?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 9 months ago
Posts
305
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies
I want to make a trigger where if any player enters a room with a trigger_multiple over it, a song plays.

I tried writing a script here, but without any luck:

Code Snippet
Plaintext
function music_1()
{
    trig_1 = GetEnt("music_trig_1", "targetname");
song_1 = struct::get("music_struct_1", "targetname");

trig_1 SetHintString("");
trig_1 SetCursorHint("HINT_NOICON");

trig_1 waittill("trigger", player);
song_1 PlayLocalSound("mus_trigger_1");

trig_1 Delete();

}

How can I do this correctly?

You can just get a struct like any other entity with GetEnt.

Also just make sure you setup the sound alias correctly with your sound file.

 
Loading ...