Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "zcommon.acs"
- script "ActionSystem" ENTER
- {
- //stamina regen system
- int buttons = GetPlayerInput(-1, INPUT_BUTTONS);
- if(buttons & BT_ALTATTACK)
- {
- delay(35);
- }
- if(buttons & BT_ATTACK)
- {
- delay(35);
- }
- if (CheckInventory("Stamina") == 0)
- {
- delay(35*2);
- GiveInventory("Stamina",1);
- }
- if(CheckInventory("Stamina") != 0)
- {
- delay(4);
- if(CheckInventory("Roll") == 1)
- {
- delay(4);
- }
- else
- {
- GiveInventory("Stamina",1);
- }
- }
- //roll system
- int button = GetPlayerInput(-1, INPUT_BUTTONS);
- delay(1);
- if(CheckInventory("Stamina") != 0)
- {
- if(button & BT_FORWARD && button & BT_CROUCH)
- {
- GiveInventory("Roll", 1);
- SetActorProperty(0, APROP_Invulnerable, 1); //start of iframes
- TakeInventory("Stamina", 33);
- ThrustThing(GetActorAngle(0) >> 8, 10, 1, 0); //angle, speed, limit, id
- delay(25); //cooldown for another roll
- SetActorProperty(0, APROP_Invulnerable, 0); //end of iframes
- TakeInventory("Roll",1);
- }
- int angle = GetActorAngle(0) >> 8;
- if(button & BT_MOVELEFT && button & BT_CROUCH )
- {
- GiveInventory("Roll", 1);
- SetActorProperty(0, APROP_Invulnerable, 1);
- TakeInventory("Stamina",33);
- ThrustThing(angle+64, 10, 1, 0);
- delay(25);
- SetActorProperty(0, APROP_Invulnerable, 0);
- TakeInventory("Roll",1);
- }
- if(button & BT_MOVERIGHT && button & BT_CROUCH)
- {
- GiveInventory("Roll", 1);
- SetActorProperty(0, APROP_Invulnerable, 1);
- TakeInventory("Stamina", 33);
- ThrustThing(angle +192 , 10, 1, 0);
- delay(25);
- SetActorProperty(0, APROP_Invulnerable, 0);
- TakeInventory("Roll",1);
- }
- if(button & BT_BACK && button & BT_CROUCH)
- {
- GiveInventory("Roll", 1);
- SetActorProperty(0, APROP_Invulnerable, 1);
- TakeInventory("Stamina",33);
- ThrustThing(angle+128, 10, 1, 0);
- delay(25);
- SetActorProperty(0, APROP_Invulnerable, 0);
- TakeInventory("Roll",1);
- }
- //sprint system
- if((button & BT_FORWARD) | (button & BT_BACK) | (button & BT_MOVELEFT) | (button & BT_MOVERIGHT) && (button & BT_SPEED) && CheckInventory("Stamina") > 2)
- {
- SetActorProperty(0, APROP_SPEED, 2.0);
- GiveInventory("IsSprinting", 3);
- TakeInventory("Stamina", 2);
- }
- else
- {
- SetActorProperty(0, APROP_SPEED, 1.0);
- TakeInventory("IsSprinting", 1);
- }
- delay(1);
- restart;
- }
- restart;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement