Forum

> > Stranded II > Scripts > Help me with run script
Forums overviewStranded II overview Scripts overviewLog in to reply

English Help me with run script

5 replies
To the start Previous 1 Next To the start

old Help me with run script

popeye654
User Off Offline

Quote
this my script

...RUN SCRIPT...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
on:keyhit02 {
     if ($s2g_runpressed==1) {skip;}
     if ($s2g_stamina>1000) {
          $s2g_runpressed=1;
          $s2g_player_speed=($s2g_player_speed*2.0);
          player_speed $s2g_player_speed;
          timer 0,1000,0,"weaken";
          freetimers 0,"runrecover";
//          msg "$s2g_player_speed";
     }
}

on:keyrelease02 {
     if ($s2g_runpressed==0) {skip;}
     $s2g_runpressed=0;
     freetimers 0,"weaken";
     timer 0,1000,0,"runrecover";
     $s2g_player_speed=($s2g_player_speed*0.5);
     player_speed $s2g_player_speed;
//     msg "$s2g_player_speed";
}

on:runrecover {
     $s2g_stamina+=500;
//     msg "$s2g_stamina";
     if ($s2g_stamina>=5000) {freetimers 0,"runrecover";}
}

on:weaken {
//     msg "$s2g_stamina";
     $s2g_stamina-=1000;
     $tmp1=(storage("unit",1,1)*-1.0);
     $tmp2=(storage("unit",1,2)*1.0);
     $tmp3=($tmp1/$tmp2);
     if ($tmp>0.8) {$s2g_stamina-=1000;}
     freevar $tmp1,$tmp2,$tmp3;
     if ($s2g_stamina<=0) {event "keyrelease02","global";}
}

Help me if u can help

tell me if u have other script

Thank you

Ps 1 : This code is from "stranded 2 Extension Mod"
Ps 2 : I'm not good at English.

old Re: Help me with run script

popeye654
User Off Offline

Quote
okay
My problem is
this script is not work in game

first time to use this script
that doesn't do any thing
_________________________________
I'm sorry about your language

old Re: Help me with run script

Assassin moder
User Off Offline

Quote
I know what is your problem and I edit script:

on:keydown02 {
if ($s2g_runpressed==1) {skip;}
if ($s2g_stamina>1000) {
$s2g_runpressed=1;
$s2g_player_speed=($s2g_player_speed*2.0);
player_speed $s2g_player_speed;
timer 0,1000,0,"weaken";
freetimers 0,"runrecover";
// msg "$s2g_player_speed";
}
}

on:keyrelease02 {
if ($s2g_runpressed==0) {skip;}
$s2g_runpressed=0;
freetimers 0,"weaken";
timer 0,1000,0,"runrecover";
$s2g_player_speed=($s2g_player_speed*0.5);
player_speed $s2g_player_speed;
// msg "$s2g_player_speed";
}

on:runrecover {
$s2g_stamina+=500;
// msg "$s2g_stamina";
if ($s2g_stamina>=5000) {freetimers 0,"runrecover";}
}

on:weaken {
// msg "$s2g_stamina";
$s2g_stamina-=1000;
$tmp1=(storage("unit",1,1)*-1.0);
$tmp2=(storage("unit",1,2)*1.0);
$tmp3=($tmp1/$tmp2);
if ($tmp>0.8) {$s2g_stamina-=1000;}
freevar $tmp1,$tmp2,$tmp3;
if ($s2g_stamina<=0) {event "keyrelease02","global";}
}


Or You also can use mine simple script:

$player_run=2.5;
$player_walk=1.6;

// SPRINTING     
     on:keydown02 {
          blur 0.5;
          consume 0,-.05,-.06,-.05;
          player_speed $player_run;
     }
     
     on:keyrelease02 {
          blur 0;
          player_speed $player_walk;
     }

EDIT: Sorry i have mistake: $player_sprint; -> $player_run

Sorry my bad
edited 1×, last 11.06.11 11:21:46 am
To the start Previous 1 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview