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

Help with custom script

broken avatar :(
Created 13 years ago
by Deleted User
0 Members and 1 Guest are viewing this topic.
2,502 views
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
Thi is my script:
Code Snippet
Plaintext
gamemode_load()
{
iprintln("^7text goes here");
  for(;;)
 {
self waittill("zom_kill");
iprintln("test");
//self thread maps\_zombiemode_name::main();
 }
}
the purpose of this script is to do another script when you kill a zombie, but when i kill a zbag, nothing happens. I commented out the actual script to test and see if it was that script, but it wont even say anything if i kill a zombie
This is how i call it:
Code Snippet
Plaintext
players = getplayers();
for(i=0;i<players.size;i++)
players[i] thread gamemode_load();

PS: i asked my friend about it and he says it should function perfectly, but it doesnt and we dont know whats wrong. Any help would be appreciated.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Code Snippet
Plaintext
waittill("zom_kill");

I don't think "zom_kill" is defined in any of the zombiemode scripts. and because it isn't defined it won't work, so your scripts pausing at that place and doesn't get to your test message.

broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
how would i define this?
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
how would i define this?

ah crap i meant notify not define but same thing, your scripts waiting for a notify that isn't set.

Code Snippet
Plaintext
level notify("zom_kill");

You need to place this somewhere where the _zombiemode scripts tracks when a zombie dies (atleast i assume you want your script to run everytime a zombie dies)

_zombiemode_score tracks when a zombie dies for scoring, maybe you can add it there?

Code Snippet
Plaintext
		case "death":
points = level.zombie_vars["zombie_score_kill"];
points += player_add_points_kill_bonus( mod, hit_location );
if(IsDefined(self.kill_tracker))
{
self.kill_tracker++;
}
else
{
self.kill_tracker = 1;
}
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 7 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.
a notify called "zom_kill" does already exist within the _zombiemode_spawner.gsc script. Call it on a player and it will wait until that player kills a zombie. No need to re-define the notify.
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
So if thats true why doesnt it work?
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 7 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 thats true why doesnt it work?
Because you probably are calling it before the game starts, call it after the game state line. I just tested exactly what you posted and it works fine for me.
Spoiler: click to open...

 
Loading ...