Advertisement
Guest User

Untitled

a guest
Jun 12th, 2019
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. payback = 0
  2.  
  3. function betterResetTools()
  4. local amount = 0
  5. if payback <= 0 then
  6. else
  7. if player.consumeCurrency("money", 10) then
  8. player.giveEssentialItem("beamaxe", "beamaxe")
  9. player.removeEssentialItem("wiretool")
  10. player.removeEssentialItem("painttool")
  11. status.setStatusProperty("bonusBeamGunRadius", 0)
  12. if payback <= 0 then
  13. else
  14. repeat
  15. player.giveItem("manipulatormodule")
  16. amount = amount + 1
  17. until amount >= payback*0.8
  18. end
  19. payback = 0
  20. updateGui()
  21. end
  22. end
  23. end
  24.  
  25. function performUpgradeNew(widgetName, widgetData)
  26. if selectedUpgradeAvailable() then
  27. local upgrade = self.upgradeConfig[self.selectedUpgrade]
  28. if player.consumeItem({name = "manipulatormodule", count = upgrade.moduleCost}) then
  29. payback = payback + upgrade.moduleCost
  30. if upgrade.setItem then
  31. player.giveEssentialItem(upgrade.essentialSlot, upgrade.setItem)
  32. end
  33.  
  34. if upgrade.setItemParameters then
  35. local item = player.essentialItem(upgrade.essentialSlot)
  36. util.mergeTable(item.parameters, upgrade.setItemParameters)
  37. player.giveEssentialItem(upgrade.essentialSlot, item)
  38. end
  39.  
  40. if upgrade.setStatusProperties then
  41. for k, v in pairs(upgrade.setStatusProperties) do
  42. status.setStatusProperty(k, v)
  43. end
  44. end
  45.  
  46. local mm = player.essentialItem("beamaxe")
  47. mm.parameters.upgrades = mm.parameters.upgrades or {}
  48. table.insert(mm.parameters.upgrades, self.selectedUpgrade)
  49. player.giveEssentialItem("beamaxe", mm)
  50.  
  51. updateGui()
  52. end
  53. end
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement