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

Can i make something move constantly

HOT
broken avatar :(
Created 9 years ago
by denis-24
0 Members and 1 Guest are viewing this topic.
4,560 views
broken avatar :(
×
broken avatar :(
Location: hr
Date Registered: 18 October 2013
Last active: 4 months ago
Posts
94
Respect
Forum Rank
Rotting Walker
Primary Group
Member
Signature
oylmeo
×
denis-24's Groups
denis-24's Contact & Social Links
lol, i thought the trigger was somewhere else in the map.. I'll change it up a bit

Double Post Merge: March 28, 2015, 03:33:18 pm
k, here we go once more :)
in radiant:
1- delete the triggers,

2- select the moving thingy's and give them the targetname   -   moving_wall
   -keep the script_vector and count KVP

3- use this script


(the doors dont take melee damage or grenade damage)

Code Snippet
Plaintext
moving_walls()
{
walls = getentarray( "moving_wall", "targetname" );
array_thread( walls,::setup_moving );
}

setup_moving()
{
self endon( "i_have_been_shot" );

self thread wait_for_hits();

for( ;; )
{
self moveto( self.origin+self.script_vector, self.count, 0, 0 );
wait self.count;
self moveto( self.origin-self.script_vector, self.count, 0, 0 );
wait self.count;
            if( !isdefined( self ) )
                break;
}
}

wait_for_hits()
{
self setcandamage( true );


for( ;; )
{
self waittill( "damage", amount, attacker, dir, org, mod );

if( !isplayer( attacker ) )
continue;

if( mod == "MOD_GRENADE" || mod == "MOD_GRENADE_SPLASH" || mod == "MOD_MELEE" )
continue;

break;
}

self notify( "i_have_been_shot" );
self setcandamage( false );

play_sound_at_pos("door_slide_open" , self.origin);
self movez(-200,5);
self waittill( "movedone" );
self delete();
}

Uh,well i now have no triggers for it in radiant,da kvp's are targetname - moving_wall , script_vector - 100 0 0 , count 3

It moves,but doesn't go away when i shoot it  :poker:
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Uh,well i now have no triggers for it in radiant,da kvp's are targetname - moving_wall , script_vector - 100 0 0 , count 3

It moves,but doesn't go away when i shoot it  :poker:

That's kinda weird, i just tried it myself to make sure and it works fine for me. You shot it with a normal bullet weapon?
and you removed all other scripts from the posts b4, and zk's one?

Btw, is it a model or a brush? If it's a model and it doesn't have bullet-collision, that might be the problem..
Last Edit: March 28, 2015, 04:21:06 pm by BluntStuffy
broken avatar :(
×
broken avatar :(
Location: hr
Date Registered: 18 October 2013
Last active: 4 months ago
Posts
94
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
denis-24's Groups
denis-24's Contact & Social Links
I figured it out,there wasn't a problem with the script,the problem was that i'm an idiot,i put nodraw decal so bullets went through  :lol:


And now,for the whole point of this,i would need the player to get points when shooting it.
I tried putting this somewhere in da script:

player maps\_zombiemode_score::add_to_player_score( 1000 );

but it says uninitialised variable player,and im still a noob at scripting,so,you know how to do it?  ;D

Last Edit: March 28, 2015, 05:15:01 pm by denis-24
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Code Snippet
Plaintext
moving_walls()
{
walls = getentarray( "moving_wall", "targetname" );
array_thread( walls,::setup_moving );
}

setup_moving()
{
self endon( "i_have_been_shot" );

self thread wait_for_hits();

for( ;; )
{
self moveto( self.origin+self.script_vector, self.count, 0, 0 );
wait self.count;
self moveto( self.origin-self.script_vector, self.count, 0, 0 );
wait self.count;
            if( !isdefined( self ) )
                break;
}
}

wait_for_hits()
{
self setcandamage( true );

attacker = undefined;
for( ;; )
{
self waittill( "damage", amount, attacker, dir, org, mod );

if( !isplayer( attacker ) )
continue;

if( mod == "MOD_GRENADE" || mod == "MOD_GRENADE_SPLASH" || mod == "MOD_MELEE" )
continue;

break;
}
        attacker maps\_zombiemode_score::add_to_player_score( 1000 );
self notify( "i_have_been_shot" );
self setcandamage( false );

play_sound_at_pos("door_slide_open" , self.origin);
self movez(-200,5);
self waittill( "movedone" );
self delete();
}

broken avatar :(
×
broken avatar :(
Location: hr
Date Registered: 18 October 2013
Last active: 4 months ago
Posts
94
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
denis-24's Groups
denis-24's Contact & Social Links
Code Snippet
Plaintext
moving_walls()
{
walls = getentarray( "moving_wall", "targetname" );
array_thread( walls,::setup_moving );
}

setup_moving()
{
self endon( "i_have_been_shot" );

self thread wait_for_hits();

for( ;; )
{
self moveto( self.origin+self.script_vector, self.count, 0, 0 );
wait self.count;
self moveto( self.origin-self.script_vector, self.count, 0, 0 );
wait self.count;
            if( !isdefined( self ) )
                break;
}
}

wait_for_hits()
{
self setcandamage( true );

attacker = undefined;
for( ;; )
{
self waittill( "damage", amount, attacker, dir, org, mod );

if( !isplayer( attacker ) )
continue;

if( mod == "MOD_GRENADE" || mod == "MOD_GRENADE_SPLASH" || mod == "MOD_MELEE" )
continue;

break;
}
        attacker maps\_zombiemode_score::add_to_player_score( 1000 );
self notify( "i_have_been_shot" );
self setcandamage( false );

play_sound_at_pos("door_slide_open" , self.origin);
self movez(-200,5);
self waittill( "movedone" );
self delete();
}


Thanks Stuffy!!  8) 8)  ;) You taught me something that can be very useful for all sorts of things in future  :rainbow:


Thanks again m8  8)
Last Edit: March 31, 2015, 02:09:14 pm by denis-24
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
sure, np. Thought i was going to see a shooting range in that vid tbh.
Make sure to mark one of them as best answer  :P
broken avatar :(
×
broken avatar :(
Location: hr
Date Registered: 18 October 2013
Last active: 4 months ago
Posts
94
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
denis-24's Groups
denis-24's Contact & Social Links
sure, np. Thought i was going to see a shooting range in that vid tbh.
Make sure to mark one of them as best answer  :P

Well da pizza bandits invaded my map so ye  :D


 
Loading ...