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 Sounds

broken avatar :(
Created 10 years ago
by pashan
0 Members and 1 Guest are viewing this topic.
1,687 views
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 3 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
Signature
×
pashan's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
How do i make a trigger play a sound.

This is the script i have.

Code Snippet
Plaintext
radio()
{
radio_trigger = getEnt("radio1_trigger", "targetname");

radio_trigger setCursorHint("HINT_NOICON");
    radio_trigger UseTriggerRequireLookAt();
    radio_trigger setHintString("Press &&1 to play radio");

radio_trigger waittill("trigger");
{
radio_trigger disable_trigger();
radio_trigger playsound("radio1");
wait 6;
radio_trigger enable_trigger();
}
}
broken avatar :(
×
broken avatar :(
RadihaX
Location: caCanada
Date Registered: 2 September 2012
Last active: 3 years ago
Posts
978
Respect
Forum Rank
The Decider
Primary Group
Community Mapper Elite
My Groups
More
My Contact & Social Links
More
Signature
Overrun
Lockdown
Overrun (Black Ops Mod)
Snowglobe
Leviathan
Abandoned School
Ski Resort
Leviathan Redux
×
JBird632'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.
Community Mapper Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
JBird632's Contact & Social LinksJBird632JBird632JBird632JBird632JBird632Mapper
Code Snippet
Plaintext
radio_trigger waittill("trigger");
{
radio_trigger disable_trigger();
radio_trigger playsound("radio1");
wait 6;
radio_trigger enable_trigger();
}
Well thats just wrong in many ways... Don't know why you put brackets around that.

This is all you need to play the sound on the trigger.
Code Snippet
Plaintext
radio_trigger playsound("radio1"); 

So just remove those brackets and you should be good to go. As a note, brackets are used only with a function, if/else statement, while/do while/for loop, and switch case. There are some others but those are your basics and should only be needed.
Last Edit: June 24, 2014, 03:14:12 am by JBird632
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 4 weeks ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Didn't show you how to do it a while ago? ???

http://ugx-mods.com/forum/index.php?topic=2843.0
Well that ^^ plays the sound for all players but you can easily change that by removing the players at the playsound and add the trigger to play the sound.

Edit: if you want to have it to play at the trigger then use this.
Code Snippet
Plaintext
#include maps\_utility; 
#include common_scripts\utility;
#include maps\_zombiemode_utility;

main()
{
thread sound();
}

sound()
{
radio_trigger = GetEnt("radio_trigger","targetname");

radio_trigger setCursorHint( "HINT_NOICON" );
radio_trigger UseTriggerRequireLookAt();
radio_trigger sethintstring ("Press &&1 to play radio");
radio_trigger waittill("trigger");

          radio_trigger disable_trigger();
  radio_trigger playsound("radio1");
  wait 6;
  radio_trigger enable_trigger();
}
Last Edit: June 24, 2014, 08:49:10 am by Ege115

 
Loading ...