soul4soul
Intermediate OT User
well i based it from master-m's buy items talkaction script which can be found here
i made it cost 20k instead of 10k. so here we go
and
to use it say !bless "first bless
some note: the script checks if the player has 5k first. then to see if he already has that blessing and if he is premium. if the player fails either of these checks he loses the 5k for wasting the spirits time. if he pass all the checks then he lose another 15k to buy the blessing. SO in total the blessing costs 20k
i made it cost 20k instead of 10k. so here we go
Code:
local items = {
["first bless"] = { price = 15000, bless = 1 },
["second bless"] = { price = 15000, bless = 2 },
["third bless"] = { price = 15000, bless = 3 },
["fourth bless"] = { price = 15000, bless = 4 },
["fifth bless"] = { price = 15000, bless = 5 }
}
function onSay(cid, words, param)
local item = items[param]
local basemoney = 5000
if item then
if doPlayerRemoveMoney(cid, basemoney) == TRUE then
if getPlayerBlessing(cid, item.bless) then
doPlayerSendTextMessage(cid, 24, "You already have that blessing, Alice's spirit took " ..basemoney.. " gold from you for wasting her time.")
elseif isPremium(cid) == TRUE then
if doPlayerRemoveMoney(cid, item.price) == TRUE then
doPlayerSendTextMessage(cid, 24, "Alice has sent her spirit to give you your "..item.."ing for "..item.price.." gold coins.")
doPlayerAddBlessing(cid, item.bless)
else
doPlayerSendTextMessage(cid, 24, "You need "..item.."ing for "..item.price.." gold coins.")
end
else
doPlayerSendTextMessage(cid, 24, "Alice's spirit reminds you, that you need premium to buy blessing. Her spirit stole "..basemoney.." from you.")
end
else
doPlayerSendTextMessage(cid, 24, "You need at least "..basemoney.." gold to contact alice's intrests and another "..item.price.." gold to buy a blessing.")
end
else
-- Sends the player a message wich includes items he can buy --
doPlayerSendTextMessage ( cid, 24, 'You can buy the following items:' )
-- Getting all the itemnames --
for item1 in pairs (items) do
-- Sends a message with each itemname and price --
doPlayerSendTextMessage ( cid, 24, item1 )
-- Ends the for function--
end
-- ends the itemname check --
end
return TRUE
end
and
Code:
<talkaction words="!bless" script="bless.lua"/>
to use it say !bless "first bless
some note: the script checks if the player has 5k first. then to see if he already has that blessing and if he is premium. if the player fails either of these checks he loses the 5k for wasting the spirits time. if he pass all the checks then he lose another 15k to buy the blessing. SO in total the blessing costs 20k
Last edited: