Fe melee kit cash per kill leaderboard

So i’m using Fe melee kit here is the link : 2021 FE Melee Kit [v1.2.13] - Roblox

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

Okay i’ll open up the studio and see what if it works and thx!

But wait in line 793 i have

Target:FindFirstChildOfClass(“Humanoid”):TakeDamage(math.floor(Damage))

So where do implement the code?

right after that line is where you would implement the code.

1 Like

It seems like it doesn’t work for some reason and doesn’t show any error in the output

It works for me though, so I don’t see the problem…

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

is the sword in another model?

No it’s just in the starter pack

can i see the function where you added the script I put?

ok here it is :

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

Note that it’s not the complete function.

what exactly is it erroring on?

On the server script at the line of GetPlayerFromCharacter :

GetPlayerFromCharacter is not a valid member of DataModel “Wanted” - Server - ServerScript:797

oh, whoops I realized what the problem is lol. it was my mistake. change the plr variable to

local plr = game.Players:GetPlayerFromCharacter(script.Parent.Parent)

I’ll also edit my original post to have the full function script :laughing:

Oh yeah i didn’t see that :grinning_face_with_smiling_eyes: too.

Although, if I messed that up and copied it from my code, idk why mine was working… It was messed up in my code too tbh

Lol how is your game getting directly The Player of the character from the game :thinking:

But anyways thx it works :grinning: !

1 Like