Forum

> > CS2D > Scripts > Money Candy Buying :)
Forums overviewCS2D overview Scripts overviewLog in to reply

English Money Candy Buying :)

2 replies
To the start Previous 1 Next To the start

old Money Candy Buying :)

Precel97
User Off Offline

Quote
hi all ! i want ask something about candy script
1
2
3
4
5
6
7
8
9
10
local mon=player(id,"money")
if m=="Shop" then
if b==1 and mon>5000 then
parse("sethealth "..id.." "..player(id,"health")+5)
parse("setmoney "..id.." "..player(id,"money")-5000)
elseif mon<5000 then
msg("©000255255You Don't Have Money To Buy A Candy!")
end
end
end
I want to create script - buying candy but when i have my max health = 100 then hp is not growing but money is lose!
and plz don't say change sethealth to setmaxhealth but i want only hp grow! When i have 100 hp and candy buyed i want to create msg - You have your maximum health and candy is don't need! this is example

plz help

old Re: Money Candy Buying :)

Yates
Reviewer Off Offline

Quote
Well, I don't know anything about lua.
But I must comment on the english, use this instead:

You don't have enough money to buy candy

old Re: Money Candy Buying :)

Danikah
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
local mon=player(id,"money")
  if m=="Shop" then
    if b==1 and mon>5000 and (player(id,"health")<100) then
      parse("sethealth "..id.." "..player(id,"health")+5)
      parse("setmoney "..id.." "..player(id,"money")-5000)
    elseif mon<5000 then
      msg("©000255255You Don't Have Money To Buy A Candy!")
    elseif (player(id,"health")=100)
      msg("©000255255You don't need a Candy!")
    end
  end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview