Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you make a custom weapon leaderboard compatible?

Asked by 6 years ago
Edited 6 years ago

I don't know how to do this every time I kill somebody it only adds to the other person's death count and doesn't add any kills for the person who killed them I'm thinking I would have to add a creator tag or something I don't know. But this is a really important part for a game I'm making does anyone know if I need to add a creator tag or not, and if so then which line do I add it to? Here are the scripts for my weapon:

Script:

                                script.Parent.Handle.Touched:connect(function(p)

                                if script.Parent.CanDamage.Value == true then

                                script.Parent.CanDamage.Value = false

                                p.Parent.Humanoid:TakeDamage(3)
                                end
                                end)

LocalScript:

(ignore the grip part)

sp=script.Parent


originalgrip=CFrame.new(0,-1,.1)
 currentgrip=originalgrip
 function swordUp()
  currentgrip=originalgrip
  sp.Grip=currentgrip
end
function swordOut()
  currentgrip=originalgrip*CFrame.Angles(math.pi/4,.4,0)
  sp.Grip=currentgrip
end
                  function spinsword(spintime)
              delay(0,function()
           local startspin=tick()
           local endspin=startspin+spintime
            while tick()<endspin do
        sp.Grip=currentgrip*CFrame.Angles(math.pi*2*((tick()-startspin)/spintime),0,0)
          wait()
      end
      sp.Grip=currentgrip
  end)
end
local CanAttack = true





script.Parent.Activated:connect(function()

local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack)



if CanAttack == true then

attack:Play()

CanAttack = false

wait(1)

attack:Stop()

CanAttack = true

script.Parent.CanDamage.Value = true

end

end)

1 answer

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
6 years ago
Edited 6 years ago

In no part of your script did you show any attempt to add a kill to the respective person's leaderstats. I'd recommend looking at ROBLOX provided Game Assets, such as the LinkedSword and Leaderboard to see how they handle KOs.

Ad

Answer this question