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

How to make a giving points on death system ?

Asked by 2 years ago
local Humanoid = script.Parent.Humanoid

function Dead()
        local tag = Humanoid:FindFirstChild("creator")
        if tag ~= nil then
        if tag.Value ~= nil then
            local leaderstats = tag.Value:FindFirstChild("DummyKilled")
            if leaderstats ~= nil then
                leaderstats.Value = leaderstats.Value +1
                wait(0.1)
                script:Remove()
            end
         end
      end
   end

Humanoid.Died:Connect(Dead)

Hey , I wanted to make a quest that when you kill 5 dummies it gives you something, there is the dummies scripts but it simply dont work.. The NumberValue is in the Humanoid of the players and im using a custom sword that I made

1 answer

Log in to vote
0
Answered by 2 years ago

Not sure if the tag would go away on death or not when inside Humanoid. Maybe put the tag in StarterGui or something.

Ad

Answer this question