#Help with kill counter script / conditional statement

1 messages · Page 1 of 1 (latest)

silver pewter
#

here is my current script for the 'Kill' counter or soul counter (same thing)

i want to make it so if you have a certain amount of 'Souls', the person who kills you gets half your souls if you have above 5 souls. Would this just be better in a whole different script or just added onto this one? and if so how would iu go abotu it?

true vigil
# silver pewter here is my current script for the 'Kill' counter or soul counter (same thing) i...

if I may assume that Killer gets filled in correctly then you can just add it onto this script

I would just write a few "return conditions", so it just stops the thread if certain conditions are not met, makes the script a bit easier to read

so in semi-psuedo code (starting at the replacement for the line if Killer and Killer.leaderstats then)

if not Killer or not Killer.leaderstats then return end
local Souls = ...
if not Souls or Souls <= 5 then return end
Souls = math.round(Souls/2) --perhaps also add in some extra math to make sure the current player souls never goes below 5 if you wish (e.g. now 6 will turn into 3 souls, yet you can add in some logic so 6 souls only gives 1 soul to the killer, leaving the plater with 5
Killer.Souls += Souls
Player.Souls -= Souls