-- !bless by Piotrek1447
-- edited by Kleksu
local bless = {1, 2, 3, 4, 5}
local cost = 10000000 -- Cost in gp.
function onSay(cid, words, param)
for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless[i])) then
doPlayerSendCancel(cid, "You have already all blessings.")
return TRUE
end
end
if(doPlayerRemoveMoney(cid, cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
end
doPlayerSendTextMessage(cid,24, "You bought all blessing.")
doSendMagicEffect(getPlayerPosition(cid), 28)
else
doPlayerSendCancel(cid, "You don't have enough money.")
end
return TRUE
end
-<function onSay(cid, words, param)
if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
doPlayerSendCancel(cid,'You have already got one or more blessings!')
else
if doPlayerRemoveMoney(cid, 70000) == TRUE then
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
else
doPlayerSendCancel(cid, "You need 70k to get blessed!")
end
end
return 1
end->
<talkaction words="!bless" script="bless.lua" />
<item id="2148" article="a" name="gold coin" plural="gold coins">
<attribute key="weight" value="10"/>
</item>
<item id="2148" article="a" name="gold coin" plural="gold coins">
<attribute key="weight" value="10"/>
<attribute key="worth" value="1"/>
</item>
<item id="2152" article="a" name="platinum coin" plural="platinum coins">
<attribute key="weight" value="10"/>
</item>
<item id="2152" article="a" name="platinum coin" plural="platinum coins">
<attribute key="weight" value="10"/>
<attribute key="worth" value="100"/>
</item>
<item id="2160" article="a" name="crystal coin" plural="crystal coins">
<attribute key="weight" value="10"/>
</item>
<item id="2160" article="a" name="crystal coin" plural="crystal coins">
<attribute key="weight" value="10"/>
<attribute key="worth" value="10000"/>
</item>
thx cykotitan
but did u read previous post ?
i solved the problem![]()