Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Copyright 1998-2012 Epic Games, Inc. All Rights Reserved.
- */
- class BreachPawn extends GamePawn
- config(Game);
- //Working on a Sprintfunction
- var float SprintTick;
- var float ReplenishTick;
- var float SprintTimer;
- exec function StartSprint()
- {
- ConsoleCommand("Sprint");
- if(SprintTimer > 0){
- ClearAllTimers(); //For better functionality use "Clear replenish timer"
- Groundspeed = 560;
- SetTimer(SprintTick, true, 'Sprinting');
- }
- }
- exec function StopSprint()
- {
- ClearAllTimers(); //For better functionality use "Clear sprint timer"
- ConsoleCommand("StopSprint");
- GroundSpeed = 280;
- SetTimer(ReplenishTick, true, 'ReplenishSprint');
- }
- simulated function Sprinting()
- {
- if(SprintTimer >= 1){
- SprintTimer = SprintTimer - 1;
- }else{
- StopSprint();
- }
- }
- simulated function ReplenishSprint()
- {
- if(SprintTimer < 10){
- SprintTimer = SprintTimer + 1;
- }else{
- ClearAllTimers(); //For better functionality use "Clear replenish timer"
- }
- }
- defaultproperties
- {
- //Jump + Speed properties
- GroundSpeed=280.0 //Speed value
- bJumpCapable=false //Toggle jump on and off
- //Sprint Properties
- SprintTimer=5.0
- SprintTick=1.0;
- ReplenishTick=4.0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement