I’ve made my melee weapons and they work pretty well but i want to make a cash per kill leaderboard using that kit but i just can’t figure out how to.I know that there is a creator tag option in it but just don’t know how to use as there isn’t any explanation what so ever on that and i already made a similar post like this here is the link :
but just didn’t get any solution!
Any help would be really appreciated! And Thx:D
at around line 793 of the script called “ServerScript” inside of the sword, it deals damage. Just add a few lines after the damage is done to check if the damaged character dies.
if Target:FindFirstChild("Humanoid").Health <= 0 then
local plr = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
if plr then
plr.leaderstats.Cash.Value += 10 ---however much you want
end
end
Wait i just saw something in the output So my game’s name is ‘Wanted’
And in the output it says : GetPlayerFromCharacter is not a valid member of DataModel “Wanted”
And btw i’m testing it on npc’s that have humanoid in them
function DealDamage(Target,Damage,BonusTable,AttackInfo) – AttackInfo is an optional argument.
if Target:FindFirstChildOfClass(“Humanoid”) ~= nil then
Target:FindFirstChildOfClass(“Humanoid”):TakeDamage(math.floor(Damage))
if Target:FindFirstChild("Humanoid").Health <= 0 then
local plr = game:GetPlayerFromCharacter(script.Parent.Parent)
if plr then
plr.leaderstats.Kills.Value += 1 ---how much you want
end
end