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 trap

broken avatar :(
Created 9 years ago
by Dust
0 Members and 1 Guest are viewing this topic.
2,538 views
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
Donate to me if you enjoy my work. https://www.paypal.me/thezombiekilla6
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
This is my first time trying to make a custom trap. I got everything set up, but the zombies do not take any damage when they walk through the damage trig on the trap. The players do however take damage so I know the damage trig is working.

I used part of makecents spinning blade trap tutorial as well as the verruckt electric trap script to get it to work, but that is the only problem.

Code Snippet
Plaintext
extinguisher_trap_damage()
{
while(1)
{
self waittill("trigger",ent);

if(IsPlayer(ent))
{
        iprintlnbold("ENT IS PLAYER");
if(ent.health > 51)
{
ent dodamage( 50, ent.origin );
}
else
{
if(!ent maps\_laststand::player_is_in_laststand())
{
radiusdamage(ent.origin,50,ent.health + 100,ent.health + 100);
}
}
}
else
{
iprintlnbold("ENT IS ZOMBIE");
ent dodamage(ent.health + 666,ent.origin);
}
}
}

Can anyone tell me if anything is wrong here? It does print "ENT IS PLAYER" when the player walks through the trap, but it doesnt print anything when the zombies do.
Last Edit: October 11, 2015, 07:25:58 pm by thezombiekilla6
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
im barely awake... but have you tried this? ;)

Code Snippet
Plaintext
while(1)
{
        ent = undefined;
self waittill("trigger",ent);

so ent becomes undefined when it loops again, prob make no difference, just a thought
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 25 June 2013
Last active: 6 days ago
Posts
3,997
Respect
1,024Add +1
Forum Rank
Eviscerator
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
×
HitmanVere'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 Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Why not just do getEntArray on zombies and have it check for those?
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
im barely awake... but have you tried this? ;)

Code Snippet
Plaintext
while(1)
{
        ent = undefined;
self waittill("trigger",ent);

so ent becomes undefined when it loops again, prob make no difference, just a thought

Tried it, still wont do any damage to the zombie
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 3 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
If the trigger is a trigger_multiple I think they only trigger when a player walks through it. Maybe you didn't set the spawnflags correctly.
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
If the trigger is a trigger_multiple I think they only trigger when a player walks through it. Maybe you didn't set the spawnflags correctly.

I am using the same trigger_multiple that is used on the electric trap in verruckt, obviously changed the targetname to match my trap.
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
I am using the same trigger_multiple that is used on the electric trap in verruckt, obviously changed the targetname to match my trap.
Ok it didnt deal damage, but did it at least print the text now?

put a wait in

wait .1;

at the end just in case
Last Edit: October 11, 2015, 07:43:24 pm by Harry Bo21
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
Ok it didnt deal damage, but did it at least print the text now?

put a wait in

wait .1;

at the end just in case

No, didnt print text either. Will try the wait
Marked as best answer by thezombiekilla6 9 years ago
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 3 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!
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
spawnflags 1
I've just tested the exact same script you're using and works for me.
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
spawnflags 1
I've just tested the exact same script you're using and works for me.

AH, I copied the trig_multiple but for some reason it didn't have the spawnflags 1 KVP. Added it now, and compling. Will let you know if it works.


yup, it works now. thanks!
Last Edit: October 11, 2015, 08:08:37 pm by thezombiekilla6

 
Loading ...