So i have a kills leaderboard and i am using fe melee kit melee weapons and i wanna know how to add a kill to that leaderboard whenever i kill a player with that weapon and i want that to be using “Creator” tag.
I tried all solutions that came into my mind and searched for tutorials but found nothing so if anyone could help ,that would very appreciated!
Could you be a little more specific?
As a beginner I don’t really know the most efficient way of doing this but there might be a lot.
I designed a gun which would cast a ray from the end point of the gun to the mouse hit position.
if the ray hits something it checks if the thing has a humanoid and checks the amount of health left
using a if statement. So my gun does 40 damage in one shot so what I did was
if RayCastResult.Instance.Parent.Humanoid.Health =< 40 then
–make my kill go up on the leaderboard
end
So the statement checked if the health is less or equal to 40 and if it is then if the bullet hits him it means he is dead (as it does 40 damage )so the kill goes up on the leaderboard
As I have said I am a beginner and there might be ways a lot more efficient but this works fine as I have used this in my project.
Ok so you know the melee weapons engine made by cadentopia. so i’m using it and i’m stuck at the part of how to add the creator tag to it so that a server script will detect the killer and give him +1 kill in his stats
Yea but my problem is that i have melee weapon’s so it uses hitbox not raycast!And i don’t know how to add in a creator tag in it so that a server script will detect the killer and give him +1 kill in his stats
Anyone could help pls? I’m stuck
Although this might not be the best solution, I’ve seen a script for a gun which had this, although I did not understand it very well at first (didn’t know what it was for).
What you’ll do is every time you hit a player, destroy and create (or simply modify) an ObjectValue, and once they get killed, reward the one who’s assigned in the ObjectValue. Ex.:
local PlayerWhoWasHit
local Creator = PlayerWhoWasHit:FindFirstChild('Creator') or Instance.new('ObjectValue', PlayerWhoWasHit) -- PlayerWhoWasHit is meant to be a character.
Creator.Name = 'Creator'
Creator.Value -- You must assign its value to the one who has attacked.
PlayerWhoWasHit.Humanoid.Died:Connect(function()
-- Give the attacker his point.
end)
Do note that this is very simplistic and there is definitely something missing. If someone is able to add to this, please do.
Oh thx for the help ima check this out and see what i can do
Unfortunately it didn’t seem to work anyone else could help ?