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

Blessing Script Doesn't Work Fine

bolero

MikeHere
Joined
Apr 13, 2009
Messages
1,146
Reaction score
12
Location
Venezuela
Code:
local cost = 100000
local premium = true
function onSay(cid, words, param)
	for i = 1, 5 do
		if getPlayerBlessing(cid, i) then
			doPlayerSendCancel(cid, "You already have one of the blessings.")
			return TRUE
		end
	end

	if not premium or premium and isPremium(cid) == TRUE then
		if not cost or cost and doPlayerRemoveMoney(cid, cost) == TRUE then
			for i = 1, 5 do
				doPlayerAddBlessing(cid, i)
			end
			doCreatureSay(cid, "You are now blessed by the GOD KandoriaOT!", TALKTYPE_ORANGE_1)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
		else
			doPlayerSendCancel(cid, "You don't have enough money.")
		end
	else
		doPlayerSendCancel(cid, "You need a premium account.")
	end
	return TRUE
end

Need the new system to tfs 0.3.5
 
Code:
local cost = 50000
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(item.itemid = 1945) then
		for i = 1, 5 do
			if(getPlayerBlessing(cid, i)) then
				doPlayerSendCancel(cid, "You already have all of the blessings.")
				doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
				return true
			end
		end
		if(getPlayerMoney(cid) < cost) then
				doPlayerSendCancel(cid, "You do not have enough money.")
				doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		elseif(not isPremium(cid)) then
			doPlayerSendCancel(cid, "You must have a premium account.")
			doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		else
			for v = 1, 5 do
				doPlayerAddBlessing(cid, v)
			end
			doPlayerRemoveMoney(cid, cost)
			doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_BLUE)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You've received all of the blessings!")
		end
	elseif(item.itemid == 1946) then
		doTransformItem(item.uid, item.itemid - 1)
	end
	return true
end
 
Code:
local cost = 50000
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(item.itemid = 1945) then
		for i = 1, 5 do
			if(getPlayerBlessing(cid, i)) then
				doPlayerSendCancel(cid, "You already have all of the blessings.")
				doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
				return true
			end
		end
		if(getPlayerMoney(cid) < cost) then
				doPlayerSendCancel(cid, "You do not have enough money.")
				doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		elseif(not isPremium(cid)) then
			doPlayerSendCancel(cid, "You must have a premium account.")
			doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		else
			for v = 1, 5 do
				doPlayerAddBlessing(cid, v)
			end
			doPlayerRemoveMoney(cid, cost)
			doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_BLUE)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You've received all of the blessings!")
		end
	elseif(item.itemid == 1946) then
		doTransformItem(item.uid, item.itemid - 1)
	end
	return true
end
Code:
	elseif(item.itemid == 1946) then
		doTransformItem(item.uid, item.itemid - 1)
	end
...
Code:
doTransformItem(item.uid, item.itemid == 1946 and 1945 or 1946)
:p
 
Back
Top