For some reason when I kill someone with the rocket launcher in the game (the regular one you can find on the official Roblox account) it doesn’t seem to make the kill count on the leader board go up
Is there a way I could make them count?
For some reason when I kill someone with the rocket launcher in the game (the regular one you can find on the official Roblox account) it doesn’t seem to make the kill count on the leader board go up
Is there a way I could make them count?
The Rocket Launcher may not insert a CreatorTag
upon the Target upon impact, & there has to be a function for when a Character specifically dies to check for that said CreatorTag
to properly increase the Player’s Kills by +1
A script would be handy to see regardless
it is true,roblox rocket launcher doesnt have creatortag making so it doesnt kill count
I mean, I creates a creator value (thats empty) and this is the leaderboard script used, I don’t know if this was the one you wanted or not.
local Template = Instance.new 'BoolValue'
Template.Name = 'leaderstats'
Instance.new('IntValue', Template).Name = "Kills"
Instance.new('IntValue', Template).Name = "Deaths"
Players.PlayerAdded:connect(function(Player)
wait(1)
local Stats = Template:Clone()
Stats.Parent = Player
local Deaths = Stats.Deaths
Player.CharacterAdded:connect(function(Character)
Deaths.Value = Deaths.Value + 1
local Humanoid = Character:FindFirstChild "Humanoid"
if Humanoid then
Humanoid.Died:connect(function()
for i, Child in pairs(Humanoid:GetChildren()) do
if Child:IsA('ObjectValue') and Child.Value and Child.Value:IsA('Player') then
local Killer = Child.Value
if Killer:FindFirstChild 'leaderstats' and Killer.leaderstats:FindFirstChild "Kills" then
local Kills = Killer.leaderstats.Kills
Kills.Value = Kills.Value + 1
end
return
end
end
end)
end
end)
end)
Try this?
local Players = game:GetService("Players")
local function AddPlr(Plr)
local Stats = Instance.new("Folder")
Stats.Name = "leaderstats"
Stats.Parent = Plr
local Kills = Instance.new("IntValue")
Kills.Name = "Kills"
Kills.Parent = Template
local Deaths = Instance.new("IntValue")
Deaths.Name = "Deaths"
Deaths.Parent = Template
print("Stats created for Player", Plr)
Plr.CharacterAdded:Connect(function(Chr)
local Humanoid = Chr:WaitForChild("Humanoid")
Humanoid.Died:Connect(function()
Deaths.Value += 1
for _, Object in pairs(Humanoid:GetChildren()) do
if Object:IsA("ObjectValue") and Object.Value and Object.Value:IsA("Player") then
local Killer = Object.Value
if Killer:FindFirstChild("leaderstats") and Killer.leaderstats:FindFirstChild("Kills") then
print(Chr.Name,"died! The victim who killed him:", Killer)
Killer.leaderstats.Kills.Value += 1
end
end
end
end)
end)
end
Players.PlayerAdded:Connect(AddPlr)
actually looked more into it there is a creator tag in the rocket launcher
it can be found in server script of the rocket launcher it looks like this just doesn’t seem to really work
creatorTag.Value = MyPlayer
creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats
local iconTag = Instance.new('StringValue', creatorTag)
iconTag.Value = Tool.TextureId
iconTag.Name = 'icon'
Where is the creatorTag
being Parented to exactly? That should be Parented last after you define your properties and such
the rocket (not the launcher) itself
there should be a script that will be cloned to the rocket, simply check if player’s health is <= to the damage, if yes then add towards the player’s kill
You could make a value within the rocket instance and fill the value with the player’s name (the player that has the rocket launcher in their hand). If the rocket touches something with a humanoid in it, it can count that kill.
--this code would be within the rocket itself
instance.Touched:Connect(function(hit)
if hit:FindFirstChild("Humanoid") then
-- counting the kill to leaderstats code (via the player value)
end
--exploding code
end)