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

Simple trigger

broken avatar :(
Created 11 years ago
by Ping998
0 Members and 1 Guest are viewing this topic.
1,549 views
broken avatar :(
×
broken avatar :(
Location: scotland
Date Registered: 2 September 2013
Last active: 2 years ago
Posts
379
Respect
Forum Rank
Perk Hacker
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Ping998
Signature
"My maps might not be the best looking, or the most hyped, but I still release them in hopes that they can make others somewhat happy"

- Ping
×
Ping998's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Ping998's Contact & Social LinksZPing998Ping998Ping998CreepersAreAwesome
Could someone do me a big favour and create a script that displays a message when a zombie passes through it (top left corner of screen)?

I'm a complete noob at scripting and I don't know where to begin  :-[

Please reply.

Thanks for reading.
Marked as best answer by CreepersAreEpic 11 years ago
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 5 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
Signature
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
Your trigger must be a trigger_multiple and have the KVP: spawnflags: 9, and here's the code. I haven't tested it but it should work:

Find
Code Snippet
Plaintext
maps\_zombiemode::main();
in your mapname.gsc and write below
Code Snippet
Plaintext
thread displayMessage();
And at the bottom of the file:
Code Snippet
Plaintext
displayMessage() {
    while(1) {
        trig = getEnt( "TRIGGER_TARGETNAME","targetname" );
        trig waittill( "trigger" );
        iPrintLn( "YOUR_MESSAGE" );
    }
}

If you want multiple triggers:
Code Snippet
Plaintext
displayMessage() {
    trig = getEntArray( "TRIGGER_TARGETNAME","targetname" );
    array_thread( trig,::waitTrigger );
}

waitTrigger() {
    while(1) {
        self waittill( "trigger" );
        iPrintLn( "YOUR_MESSAGE" );
    }
}
Just change the upper-case words to yours.
broken avatar :(
×
broken avatar :(
Location: scotland
Date Registered: 2 September 2013
Last active: 2 years ago
Posts
379
Respect
Forum Rank
Perk Hacker
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Ping998
×
Ping998's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Ping998's Contact & Social LinksZPing998Ping998Ping998CreepersAreAwesome
Great! Thank you so much!  ;D
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 3 years ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
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
http://ugx-mods.com/forum/index.php/topic,7268.0.html

In trigger_func() remove the ! in maps\_zombiemode_utility::is_player_valid(entity)

This will make it always it an AI.


 
Loading ...