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

how do i make audio play when looking at target lookat?

HOT
broken avatar :(
Created 12 years ago
by NaviLlusShore
0 Members and 1 Guest are viewing this topic.
10,891 views
broken avatar :(
×
broken avatar :(
Location: usThe North Pole
Date Registered: 12 September 2013
Last active: 11 years ago
Posts
123
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
I have come from the future
Signature
NaviLlicious
×
NaviLlusShore's Groups
NaviLlusShore's Contact & Social LinksTheHubbyNaviLlusShore
so now if i build mod and compile i go into the game and it use the trigger?
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 6 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
Signature

(Click to enter portfolio)
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
so now if i build mod and compile i go into the game and it use the trigger?
It still won't do anything. In the script all that will happen is when you hit the trigger it will reach the end of the function. You have to add code now for whatever effect you want it to have.
broken avatar :(
×
broken avatar :(
Location: usThe North Pole
Date Registered: 12 September 2013
Last active: 11 years ago
Posts
123
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
I have come from the future
×
NaviLlusShore's Groups
NaviLlusShore's Contact & Social LinksTheHubbyNaviLlusShore
so if i wanted to add audio to play how would i do that to a trigger
Last Edit: September 16, 2013, 12:25:42 am by NaviLlusShore
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 6 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
so if i wanted to add a sound que how would i do that to a trigger
a couple ways you can do it. You could just do:
Code Snippet
Plaintext
trigger playsound("SOUNDNAME");
you could also make it player specific:
Code Snippet
Plaintext
players[0] playsound("SOUNDNAME");
Those both will play through the whole map at full volume though, like a music box would. If you want the sound to get quieter as you move away from it you will want to play the sound on a script_struct.
broken avatar :(
×
broken avatar :(
Location: usThe North Pole
Date Registered: 12 September 2013
Last active: 11 years ago
Posts
123
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
I have come from the future
×
NaviLlusShore's Groups
NaviLlusShore's Contact & Social LinksTheHubbyNaviLlusShore
and i put those in the same function that was just made?
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 6 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
and i put those in the same function that was just made?
The one you choose yeah, but if you use the players one you gotta make sure the variable players is defined before using it. Info on that can be found on the variables page of the UGX Scripting Wiki Section. the function you want to set it to is:
Code Snippet
Plaintext
players = GetPlayers();
broken avatar :(
×
broken avatar :(
Location: usThe North Pole
Date Registered: 12 September 2013
Last active: 11 years ago
Posts
123
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
I have come from the future
×
NaviLlusShore's Groups
NaviLlusShore's Contact & Social LinksTheHubbyNaviLlusShore
so players = GetPlayers(); will be in the function as well for whichever one i choose?
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 6 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
so players = GetPlayers(); will be in the function as well for whichever one i choose?
yeah
broken avatar :(
×
broken avatar :(
Location: usThe North Pole
Date Registered: 12 September 2013
Last active: 11 years ago
Posts
123
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
I have come from the future
×
NaviLlusShore's Groups
NaviLlusShore's Contact & Social LinksTheHubbyNaviLlusShore
   setup()
{
   trigger = getEnt("zk_eggtrig","targetname");

   self setHintString("&&1 hintstring");

    trigger waittill("trigger");
   
   trigger playsound("zk_egg");

   players = GetPlayers();
}

is that right?
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 6 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
   setup()
{
   trigger = getEnt("zk_eggtrig","targetname");

   self setHintString("&&1 hintstring");

    trigger waittill("trigger");
   
   trigger playsound("zk_egg");

   players = GetPlayers();
}

is that right?
If your playing the sound on the trigger then you don't need the players variable.

 
Loading ...