• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ only 2 take frag tfs 1.5 nekiro 7.72

bpm91

Intermediate OT User
Joined
May 23, 2019
Messages
928
Solutions
7
Reaction score
127
Location
Brazil
YouTube
caruniawikibr
hi, I would like to know how do I make it so that only the last 2 people who hit get the frag on the player
tfs 1.5 7.72 nekiro
 
Well if you ask how then here is how to make it.

onHealthChange function
global variable storing the attacking player at VAR1 but with a checker that says if var1 contains a player then set var2 = var1 and var1 = newAttackingPlayer

don't forget to be using ids like this
local VAR1 = player:getId()
and to re-call it as player do
local VAR1PLAYER = Player(VAR1)
because you will make var1 and var2 global variables to check on them at wherever the code that decides to addFragTime


Very Important Note
Global Variables : They are dangerous if your knowledge is limited about coding and how programs works.

When you add local before the variable this variable is call-able on inside this LUA file BUT if you didn't add local this variable is call-able from anyplace on your lua files in your server so becareful and don't use something like player/target/monster/ the already chosen names for main functions parameters
 
Back
Top