Advertisement
giganciprogramowania

lekcja 8 DropsClient

Apr 6th, 2023
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. local function updateDamage()
  2. local playerPets = playersFolder[player.Name]:GetChildren()
  3. for _, pet in pairs(playerPets) do
  4. local attackValue = pet.Attack.Value
  5. if attackValue then
  6. local drop = attackValue.Parent
  7. local currentPoints = drop.CurrentPoints
  8. currentPoints.Value = math.max(currentPoints.Value - pet.Damage.Value, 0)
  9. if currentPoints.Value == 0 then
  10. for _, pet in pairs(playerPets) do
  11. pet.Attack.Value = nil
  12. end
  13. for i, item in pairs(drop:GetChildren()) do
  14. if item.Name == "Reward" then
  15. remotes.Bank:FireServer("+", item.Value, item.Amount.Value)
  16. end
  17. end
  18. destroyDrop(drop)
  19. end
  20. end
  21. end
  22. end
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement