Search code examples
luarobloxluau

What is the best form to make a reward from a kill in game


Well, i need to know how to make this system for a game in Roblox, but i tried to use tag creator and this tag only works for tools, in this case i want to make skills and if a dummy dies the player receives a kind of reward. How i can make this? I have no idea, much less a code.


Solution

  • In order to reward a player, you will just need to check if the player is dead whenever you deal damage to them. (That's the point of the tag creator system)

    So in your skill script, whenever you have

    humanoid:TakeDamage(1234)
    -- insert check here, whether that be using the tag creator system or just doing manual checks
    -- ex:
    if humanoid:GetState() == Enum.HumanoidStateType.Dead then
        playerWhoPerformedSkill.leaderstats.Cash.Value += 100 -- or whatever you want to do to reward!
    end