Forum

> > Trash > custom upgrade price
ForenübersichtTrash-ÜbersichtEinloggen, um zu antworten

Englisch custom upgrade price

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

geschlossen verschoben custom upgrade price

Zurak
User Off Offline

Zitieren
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?

alt Re: custom upgrade price

Apache uwu
User Off Offline

Zitieren
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.

alt Re: custom upgrade price

DC
Admin Off Offline

Zitieren
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.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenTrash-ÜbersichtForenübersicht