Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- payback = 0
- function betterResetTools()
- local amount = 0
- if payback <= 0 then
- else
- if player.consumeCurrency("money", 10) then
- player.giveEssentialItem("beamaxe", "beamaxe")
- player.removeEssentialItem("wiretool")
- player.removeEssentialItem("painttool")
- status.setStatusProperty("bonusBeamGunRadius", 0)
- if payback <= 0 then
- else
- repeat
- player.giveItem("manipulatormodule")
- amount = amount + 1
- until amount >= payback*0.8
- end
- payback = 0
- updateGui()
- end
- end
- end
- function performUpgradeNew(widgetName, widgetData)
- if selectedUpgradeAvailable() then
- local upgrade = self.upgradeConfig[self.selectedUpgrade]
- if player.consumeItem({name = "manipulatormodule", count = upgrade.moduleCost}) then
- payback = payback + upgrade.moduleCost
- if upgrade.setItem then
- player.giveEssentialItem(upgrade.essentialSlot, upgrade.setItem)
- end
- if upgrade.setItemParameters then
- local item = player.essentialItem(upgrade.essentialSlot)
- util.mergeTable(item.parameters, upgrade.setItemParameters)
- player.giveEssentialItem(upgrade.essentialSlot, item)
- end
- if upgrade.setStatusProperties then
- for k, v in pairs(upgrade.setStatusProperties) do
- status.setStatusProperty(k, v)
- end
- end
- local mm = player.essentialItem("beamaxe")
- mm.parameters.upgrades = mm.parameters.upgrades or {}
- table.insert(mm.parameters.upgrades, self.selectedUpgrade)
- player.giveEssentialItem("beamaxe", mm)
- updateGui()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement