coding_giants

l18 mainServer

Mar 21st, 2024
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- ================ Old code ==================
  2. game.ReplicatedStorage.Remotes.EquipPet.OnServerEvent:Connect(function(player,
  3. petName, id)
  4. local petModel = game.ReplicatedFirst.Pets:FindFirstChild(petName):Clone()
  5. petModel.Parent = workspace.Players:FindFirstChild(player.Name)
  6. -- ============== Comment out / remove the line ==============
  7. --player.Values.Damage.Value += petModel.Damage.Value
  8. petModel.Id.Value = id
  9. end)
  10.  
  11. game.ReplicatedStorage.Remotes.UnequipPet.OnServerEvent:Connect(function(player,
  12. petName, id)
  13. local playerFolder = workspace.Players:FindFirstChild(player.Name)
  14. for i, pet in pairs(playerFolder:GetChildren()) do
  15. if pet.Id.Value == id then
  16. -- ============== Comment out / remove the line ==============
  17. -- player.Values.Damage.Value -= pet.Damage.Value
  18. pet:Destroy()
  19. end
  20. end
  21. end)
  22. -- ======================New code=============================
  23. game.ReplicatedStorage.Remotes.Upgrade.OnServerEvent:Connect(function(player, cost, damage)
  24. player.leaderstats.Shards.Value -= cost
  25. player.Values.Damage.Value = damage
  26. end)
  27. -- ======================End of new code =================
  28.  
Add Comment
Please, Sign In to add comment