Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Sprint Questions
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#1
Sprint Questions

Hey all-

First off, is it possible to "disable sprint" and secondly, if the player is crouched, is it possible to kill them if they stand or sprint?

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

04-08-2012, 06:50 PM
Website Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Sprint Questions

void SetPlayerRunSpeedMul(0);


Then just have a script area above the player so when he's crouching, he doesn't collide with it, then when he stands, he'll collide and set the player's health to 0. or give 100 damage
(This post was last modified: 04-08-2012, 07:25 PM by Statyk.)
04-08-2012, 07:24 PM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#3
RE: Sprint Questions

Oh, derp. Thats simple enough. Thanks Statyk. I almost forgot, +1 feedback for you good sir! Big Grin

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

04-08-2012, 08:21 PM
Website Find
Mackiiboy Offline
Member

Posts: 101
Threads: 7
Joined: Jan 2012
Reputation: 11
#4
RE: Sprint Questions

(04-08-2012, 06:50 PM)JetlinerX Wrote: Hey all-

First off, is it possible to "disable sprint" and secondly, if the player is crouched, is it possible to kill them if they stand or sprint?
.
Ya'll prolly not need this, but maybe you will if you're going to put up a script if the player starts to sprint.
Then you could put up a timer that checks the player's speed. If the player's speed gets bigger than a certain amount, then something will happen.

void speedtimer(string &in asTimer)
{
AddTimer("speedtimer", 0.2f, "speedtimer");
if (GetPlayerSpeed() >=MAX_ALLOWED_SPEED )
{
SOMETHING HAPPENS
}
}






04-09-2012, 12:19 AM
Website Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#5
RE: Sprint Questions

T'anks brah. =P

And Sorry, I missed that "or sprint". Could've cleared that up but Mackiiboy has it taken care of...
04-09-2012, 02:38 AM
Find




Users browsing this thread: 2 Guest(s)