• 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!

Need the Talkaction !bless

Hi i am need the talkaction !bless and wehn the ppls use that he need to get all blesses pleas who give me the script i give him rep+++

Add this line in /data/talkactions/talkactions.xml
Code:
<talkaction access="0" log="no" filter="word" words="!bless" script="bless.lua" />

Then create a new .lua file and call it bless.lua
Insert:
Code:
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, 50000) == 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 50k to get blessed!")
        end
    end    
    return 1
end
 
Credits: piotrek1447

data/talkactions/talkactions.xml
PHP:
<talkaction words="!bless" script="bless.lua"/>

data/talkactions/scripts/bless.lua
LUA:
local bless = {1, 2, 3, 4, 5}
local cost = 50000 -- Cost in gp.
 
function onSay(cid, words, param)
	for i = 1, table.maxn(bless) do
		if(getPlayerBlessing(cid, bless[i])) then
			doPlayerSendCancel(cid, "You already have 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 have bought all blessings.")
		doSendMagicEffect(getPlayerPosition(cid), 28)
	else
		doPlayerSendCancel(cid, "You don't have enough money.")
	end
	return TRUE
end
 
Last edited:
Instead of adding this: (in talkactions.xml)
PHP:
	<talkaction words="!bless" script="bless.lua"/>
add:
PHP:
	<talkaction words="!bless" event="script" value="bless.lua"/>
 
Back
Top