Forum

> > Trash > custom upgrade price
Forums overviewTrash overviewLog in to reply

English custom upgrade price

2 replies
To the start Previous 1 Next To the start

closed moved custom upgrade price

Zurak
User Off Offline

Quote
im trying to make my first script and it requires a custom building upgrade price but i could not find anything, idk if it can be changed with lua but im thinking of something like giving the player x amount of money every time he tries to upgrade/heal a building can this be done?

old Re: custom upgrade price

Apache uwu
User Off Offline

Quote
Like this?

1
2
3
4
5
6
7
8
9
10
addhook("objectupgrade","_objectupgrade")

upgrade_price=1000

function objectupgrade(id,_player,progress,total)
	if player(_player,"money")-upgrade_price<0 then
		return 1
	end
	parse("setmoney "..id.." "..player(_player,"money")-upgrade_price)
end

However I think $100 will still be subtracted, you could implement your own upgrade, or make sure that the money you take away is 100 less, because 100 is already taken.

old Re: custom upgrade price

DC
Admin Off Offline

Quote
Trashed because thread has been opened twice...
@user Zurak: Don't resubmit the form if you're using the history forward/back navigation buttons in your browser. Or better: Don't use them at all.
To the start Previous 1 Next To the start
Log in to replyTrash overviewForums overview