• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Blessings?

Majeski20

New Member
Joined
Apr 21, 2008
Messages
602
Reaction score
4
Location
Sweden
Doesnt blessing works on 8.1 :eek:?
I think i have tried ALL scripts and no one works.

If somone knows that it works please post that script :)

Thanks.
 
mmmmmmmm use talkactions
is more easy men

bless.lua
PHP:
local bless = {1, 2, 3, 4, 5}
local cost = 50000 -- Cost in gp.
local maxlevel = 1000

function onSay(cid, words, param)
local lvl = getPlayerLevel(cid)
local new_cost = (lvl * cost) / 500
local target = getPlayerGUID(cid)


for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless[i])) then
doPlayerSendCancel(cid, "You already have been blessed.")
return TRUE
end
end

if (getPlayerLevel(cid) >= maxlevel) then
if(doPlayerRemoveMoney(cid, new_cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
doPlayerSendTextMessage(cid,19,"You have successfully all blessing , now do not need aol.")
end
else
doPlayerSendTextMessage(cid,19,"You need to have "..new_cost.."gp to buy blessings.")
end

elseif(getPlayerLevel(cid) < maxlevel) then
if(doPlayerRemoveMoney(cid, cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
end
doPlayerSendTextMessage(cid,19,"You have successfully been blessed.")
else
doPlayerSendTextMessage(cid,19,"You need to have "..cost.."gp to buy blessings.")
end
end
return FALSE
end

Talkactions.xml
PHP:
<talkaction words="!bless" event="script" value="bless.lua" />
 
Post your script :p

My bless script?

Code:
local bless = {1, 2, 3, 4, 5}
local cost = 50000 -- Cost in gp.
local maxlevel = 1000

function onSay(cid, words, param)
local lvl = getPlayerLevel(cid)
local new_cost = (lvl * cost) / 500
local target = getPlayerGUID(cid)


for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless[i])) then
doPlayerSendCancel(cid, "You already have been blessed.")
return TRUE
end
end

if (getPlayerLevel(cid) >= maxlevel) then
if(doPlayerRemoveMoney(cid, new_cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
doPlayerSendTextMessage(cid,19,"You have successfully all blessing , now do not need aol.")
end
else
doPlayerSendTextMessage(cid,19,"You need to have "..new_cost.."gp to buy blessings.")
end

elseif(getPlayerLevel(cid) < maxlevel) then
if(doPlayerRemoveMoney(cid, cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
end
doPlayerSendTextMessage(cid,19,"You have successfully been blessed.")
else
doPlayerSendTextMessage(cid,19,"You need to have "..cost.."gp to buy blessings.")
end
end
return FALSE
end

talkactions.xml

Code:
<talkaction words="!bless" script="bless.lua" />
 
PHP:
function onSay(cid, words, param)
if doPlayerRemoveMoney(cid,1000000) == 1 then -- change price to what ever you want
    StdModule.bless, bless = 1,
    StdModule.bless, bless = 2,
    StdModule.bless, bless = 3,
    StdModule.bless, bless = 4,
    StdModule.bless, bless = 5
    doSendMagicEffect(getPlayerPosition(cid),12)
    doPlayerSendTextMessage(cid,22,"You've bought all the blessings!")
else
    doPlayerSendCancel(cid,"You don't have enough money.")
    doSendMagicEffect(getPlayerPosition(cid),2)
end
return TRUE
end
 
Last edited:
PHP:
function onSay(cid, words, param)
if doPlayerRemoveMoney(cid,1000000) == 1 then -- change price to what ever you want
    StdModule.bless, bless = 1,
    StdModule.bless, bless = 2,
    StdModule.bless, bless = 3,
    StdModule.bless, bless = 4,
    StdModule.bless, bless = 5
    doSendMagicEffect(getPlayerPosition(cid),12)
    doPlayerSendTextMessage(cid,22,"You've bought all the blessings!")
else
    doPlayerSendCancel(cid,"You don't have enough money.")
    doSendMagicEffect(getPlayerPosition(cid),2)
end
return TRUE
end

The problem is that u still loose lvls and bp :/
 
Change the bless file to this:
Lua:
function onSay(cid, words, param)
local storage = 1337 --Change this to any number not in use

	if getPlayerStorageValue(cid, 1337) == 1 then
		doPlayerSendCancel(cid, "You already have blessings.")
	else
		if doPlayerRemoveMoney(cid,100000) == 1 then
			setPlayerStorageValue(cid, 1337, 1)
			doSendMagicEffect(getPlayerPosition(cid), 12) 
			doPlayerSendTextMessage(cid, 22, "Blessings acquired.") 
		else
			doPlayerSendCancel(cid,"You don't have enough money.") 
			doSendMagicEffect(getPlayerPosition(cid),2) 
		end 
	end

	return TRUE 
end

and make a new creature script, don't forget to register it in login.lua:

Lua:
onPrepareDeath(cid, deathList)

	if getPlayerStorage(cid, 1337) == 1 then
		doTeleportThing(cid, getTownTemplePosition (1))
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
		setPlayerStorageValue(cid, 1337, -1)
		doPlayerSendTextMessage(cid, 27, "Your blessings have saved you, do not forget to buy new ones!")
	end
	
	return true
end
 
Back
Top