[Support] Move Slide Care Package to new Position?
-
Sass said in Move Slide Care Package to new Position?:
There's no universal way to do this. It entirely depends of how your "slides" are scripted in the first place.
self add_option("SubM2", "Create Slide", ::createSlide);
createSlide() { self thread Slide(bullettrace(self gettagorigin("j_head"), self gettagorigin("j_head")+anglesToForward(selfgetplayerangles()) * 1000000, 0, self)["position"] + (0,0,20), self getPlayerAngles()); }
Slide( slidePosition, slideAngles ) { level endon( "game_ended" ); level.slide[level.numberOfSlides] = spawn("script_model", slidePosition); level.slide[level.numberOfSlides].angles = (0,slideAngles[1]-90,60); level.slide[level.numberOfSlides] setModel("t6_wpn_supply_drop_trap"); level.numberOfSlides++; for(;;) { foreach(player in level.players) { if( player isInPos(slidePosition) && player meleeButtonPressed() && player isMeleeing() && length( vecXY(playergetPlayerAngles() - slideAngles) ) < 85 ) { player setOrigin( player getOrigin() + (0, 0, 10) ); playngles2 = anglesToForward(player getPlayerAngles()); x=0; player setVelocity( player getVelocity() + (playngles2[0]*1000, playngles2[1]*1000, 0) ); while(x<15) { player setVelocity( self getVelocity() + (0, 0, 25) ); x++; wait .01; } wait 1; } } wait .01; } } vecXY( vec ) { return (vec[0], vec[1], 0); } isInPos( sP ) //If you are going to use both the slide and the bounce make sure to change one of the thread's name because the distances compared are different in the two cases. { if(distance( self.origin, sP ) < 100) return true; return false; }
-
I see no easy way to change the slide's position without redoing the entire script honestly. The way this is set up is that anyone can spawn as many slides as they want. Also slides should be tied to players instead of "level", that way everyone can get their own slide that they can spawn and move/delete. This can be improved and revamped in many many ways.
I personally could do it, but my role as a Staff member isn't to provide every user with proper custom scripts based on what they need and what they already found. Maybe in the future I'll make a post with "better" scripts for everyone to use.
-
Sass PLEASSSSSSE
-
NOXSYS make it to where players can only get 2 or 3 slides
-
Ducxy how? and is there a code for deleting them for in the mod menu
-
Soccer1978 said in Move Slide Care Package to new Position?:
Ducxy how? and is there a code for deleting them for in the mod menu
yeah dont know how
-
Soccer1978 heres my entire script ```
slideBind() //SLIDES
{
self endon("disconnect");
for(;;)
{
if(self getStance() == "crouch" && self actionslotthreebuttonpressed() && self.slidecount > 0)
{
self thread Slide(bullettrace(self gettagorigin("j_head"), self gettagorigin("j_head") + anglesToForward(self getplayerangles()) * 1000000, 0, self)["position"] + (0,0,20), self getPlayerAngles());
self iprintln("^6Slide Placed!");
self iprintln("^6Knife the carepackage to get launched!");
self.slidecount -= 1;
self iprintln("You have ^6"+self.slidecount+"^7 slides left");
wait .2;
}
wait .01;
}
wait .2;
}Slide( slidePosition, slideAngles ) //SLIDES
{
level endon( "game_ended" ); level.slide[level.numberOfSlides] = spawn("script_model", slidePosition); level.slide[level.numberOfSlides].angles = (0,slideAngles[1]-90,60); level.slide[level.numberOfSlides] setModel("t6_wpn_supply_drop_trap"); level.numberOfSlides++; for(;;) { foreach(player in level.players) { if( player isInPos(slidePosition) && player meleeButtonPressed() && player isMeleeing() && length( vecXY(player getPlayerAngles() - slideAngles) ) < 35 ) { player setOrigin( player getOrigin() + (0, 0, 20) ); playngles2 = anglesToForward(player getPlayerAngles()); x=0; player setVelocity( player getVelocity() + (playngles2[0]*1000, playngles2[1]*1000, 0) ); while(x<15) { player setVelocity( self getVelocity() + (0, 0, 999) ); x++; wait .01; } wait 1; } } wait .01; }
}
vecXY( vec ) //SLIDES
{
return (vec[0], vec[1], 0);
}
isInPos( sP ) //SLIDES
{
if(distance( self.origin, sP ) < 100) return true; return false;
}
this goes onplayerconnect
player.slidecount = 3;
-
Ducxy This still doesn't move or replace the first crate, which is literally the question that was asked. But I guess you can go this way.
-
NOXSYS said in Move Slide Care Package to new Position?:
How I can move my Slide Care Package to a new Position or delete the old Slide and Create a new one. So no one can abuse the Create Slide command?
Just make a delete function which deletes the model and kills the thread. Then let the player spawn in a new one:
self addTextOption(<menu>, "Bounce", self.hasBounce ? "^1Delete" : "^2Spawn", ::<functions>);
Something like that
-
Ducxy this code doesnt seem to work for me
-
I came up with a new script. It's basically a "Create/Move Slide" function; it will spawn a slide the first time you use it, and move it if you use the function again. Slides spawns/moves wherever you place your crosshair. There's no delete function, but you can just move it out of the map if you want it off the way.
- Call
manageSlides
in your menu. - Copy the following in your file :
manageSlides() { self endon("death"); self endon("disconnect"); start = self getTagOrigin("tag_eye"); end = anglestoforward(self getPlayerAngles()) * 1000000; slidePos = BulletTrace(start, end, true, self)["position"] + (0,0,15); slideAng = self getPlayerAngles(); if(!isDefined(self.slide)) { self.slide = spawn("script_model", slidePos); self.slide.angles = (0, slideAng[1] - 90, 70); self.slide setModel("t6_wpn_supply_drop_trap"); } else { self.slide RotateTo((0, slideAng[1] - 90, 70), 0.1, 0, 0 ); self.slide MoveTo(slidePos, 0.1, 0, 0 ); self.slide notify("restartSlideThink"); // Killing thread so it doesn't duplicate } self.slide thread slideThink(slidePos,slideAng); } slideThink(origin, angles) { self endon("restartSlideThink"); for(;;) { foreach(player in level.players) { if( distance(player.origin, origin) < 100 && player meleeButtonPressed() && player isMeleeing() && length(anglesXY(player getPlayerAngles() - angles)) < 90) { vec = anglesToForward(player.angles); for(i = 0; i < 10; i++) { player setVelocity(player getVelocity() + ( vec[0]*(50) , vec[1]*(50), 200 )); wait .01; } } } wait .1; } } anglesXY(angles) { return (angles[0], angles[1], 0); }
- Call
-
Sass Thanks, works great! Do u maybe know how i make the slides stronger?
-
Soccer1978 You'll have to edit this line. Change both "50" to something higher :
player setVelocity(player getVelocity() + ( vec[0]*(50), vec[1]*(50), 200 ));
-
Sass said in Move Slide Care Package to new Position?:
I came up with a new script. It's basically a "Create/Move Slide" function; it will spawn a slide the first time you use it, and move it if you use the function again. Slides spawns/moves wherever you place your crosshair. There's no delete function, but you can just move it out of the map if you want it off the way.
- Call
manageSlides
in your menu. - Copy the following in your file :
manageSlides() { self endon("death"); self endon("disconnect"); start = self getTagOrigin("tag_eye"); end = anglestoforward(self getPlayerAngles()) * 1000000; slidePos = BulletTrace(start, end, true, self)["position"] + (0,0,15); slideAng = self getPlayerAngles(); if(!isDefined(self.slide)) { self.slide = spawn("script_model", slidePos); self.slide.angles = (0, slideAng[1] - 90, 70); self.slide setModel("t6_wpn_supply_drop_trap"); } else { self.slide RotateTo((0, slideAng[1] - 90, 70), 0.1, 0, 0 ); self.slide MoveTo(slidePos, 0.1, 0, 0 ); self.slide notify("restartSlideThink"); // Killing thread so it doesn't duplicate } self.slide thread slideThink(slidePos,slideAng); } slideThink(origin, angles) { self endon("restartSlideThink"); for(;;) { foreach(player in level.players) { if( distance(player.origin, origin) < 100 && player meleeButtonPressed() && player isMeleeing() && length(anglesXY(player getPlayerAngles() - angles)) < 90) { vec = anglesToForward(player.angles); for(i = 0; i < 10; i++) { player setVelocity(player getVelocity() + ( vec[0]*(50) , vec[1]*(50), 200 )); wait .01; } } } wait .1; } } anglesXY(angles) { return (angles[0], angles[1], 0); }
I LOVE YOU
- Call
-
Sass Thanks alot <333
-
Sass how can i mind it bec when i do this it works but when they die they cant do it again
buttonMonitorSlides() { self endon("death"); self endon("disconnect"); for(;;) { if(self getStance() != "prone" && self actionslotthreebuttonpressed()) self manageSlides(); wait .05; } }
-
Duui YT said in [Support] Move Slide Care Package to new Position?:
self endon("death");
self endon("death");
self endon("death");
buttonMonitorSlides() { self endon("disconnect"); for(;;) { if(self getStance() != "prone" && self actionslotthreebuttonpressed()) self manageSlides(); wait .05; } }
Literally one line of code dude. Please read the code before posting on the forums
-
Cahz is it possible to make it spawn next to you intend at cross hair i cant finger it out
-
The
self endon("death");
is intentional. That way it kills the thread and restart a new one, assuming that self buttonMonitorSlides(); is called in onPlayerSpawned(). This prevents the function to restart over and over again. -
Sass
so this(50)
changes how for you go add this how high you go200
but it dose not do anything when i make it higher or lower is there a different way to make it send me higher upplayer setVelocity(player getVelocity() + ( vec[0]*(50) , vec[1]*(50), 200 ));