I made a script where i can get kills added in leaderboard if i get 1 kill it adds but when i kill it doesnt work and i use ACS 1.7.6 gun kit so how do i get the kill count in leaderboard. I put the script in Server Script Storage in Script.
Script : game.Players.PlayerAdded:connect(function(player)
local folder = Instance.new(“Folder”,player)
folder.Name = “leaderstats”
local currency1 = Instance.new(“IntValue”,folder)
currency1.Name = “Kills”
player.CharacterAdded:connect(function(character)
character:WaitForChild(“Humanoid”).Died:connect(function()
local tag = character.Humanoid:FindFirstChild(“creator”)
if tag ~= nil then
if tag.Value ~= nil then
currency1.Value = currency1.Value + 10
end
end
end)
end)
end)
looks like its detecting something called tag or creator which when the player died the tag or creator value which contain the player name that hit him so you can create a creator value when they hit somebody and this creator value will be the player Name that hit the other
the gun must probably have a raycast system in it so in the script where there is if Raycast then etc… you can add a fire server to a remote where it handle damage etc then write these lines like:
local creator = Instance.new("StringValue")
creator.Value = plr.Name
creator.Parent = hit -----these variable should be shared through a remoteEvent parameter
the problem is you have a different script in your FE gun kit but nonless here is a lines of how to create the creator value
local Event = -------your remote event
Event.OnServerEvent:connect(function(plr,hit)
local creator = Instance.new("StringValue", hit)
creator.Value = plr.Name
end)
in your FE gun kit you probably have a raycast system that handle damage right? so why not creating the creator value through that but i dont really know what is your script in your FE gun kits but that all i have