how can i make killstreaks in unity

Posts 1–5 of 5 · Page 1 of 1
how can i make killstreaks in unity
i am dying to learn it can someone give me a good tutorial on how to do it thank you in advance
Make an integer variable which stores kills since last death. Some pseudocode:
Code:
var ksld = 0;
function onKill(){
++ksld;
if(ksld == 5){ //5 killstreak
//do the killstreak
}
}
function onDeath(){
ksld = 0;
}
Quote Originally Posted by Saltine View Post
Make an integer variable which stores kills since last death. Some pseudocode:
Code:
var ksld = 0;
function onKill(){
++ksld;
if(ksld == 5){ //5 killstreak
//do the killstreak
}
}
function onDeath(){
ksld = 0;
}
That wouldn't full work.


Code:
static var killTimer=0;

function Update() {
InvokeRepeating ("Countdown", 1.0, 1.0);
}

function Countdown() {
if (--killTimer == 0) CancelInvoke ("Countdown");
}
Quote Originally Posted by Flengo Jr. View Post
That wouldn't full work.


Code:
static var killTimer=0;

function Update() {
InvokeRepeating ("Countdown", 1.0, 1.0);
}

function Countdown() {
if (--killTimer == 0) CancelInvoke ("Countdown");
}
He wanted kill streaks not a kill timer?
Quote Originally Posted by Saltine View Post

He wanted kill streaks not a kill timer?
oh i didn't read it write.
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Talk with us