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

Lua Blessing Bug

Bonnen888

Member
Joined
Oct 19, 2008
Messages
99
Reaction score
7
Location
Sweden
Hello. I got this problem. That no blessings i try doesnt work. Every single time i drop "Backpack" and "Items". I have tried check on Search for a solved case as this one.

So im really starting to wonder if it cant be my Datebase.

Im using the [9.46] The Forgotten Server v0.2.12 (Mystic Spirit). And the lastest forgottenserver.sql.

So im really wondering why it never want to work.

Can it be a other problem??

Please i need help.

So i would love to give u rep if u can help me.
 
This is one of them all i have tried.

Dont you got any good scripts that works 0.2

PHP:
function onSay(cid, words, param)
local fail = 0

if getPlayerLevel(cid) < 31 then
cost = 2000
else
cost = ((getPlayerLevel(cid) - 30) * 200) + 2000
end

if cost > 20000 then
cost = 20000
end

for i = 1, 5 do
if getPlayerBlessing(cid, i) then
fail = fail + 1
else
if doPlayerRemoveMoney(cid, cost) == TRUE then
doPlayerAddBlessing(cid, i)
if i == 5 and not(fail == 5) then
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
end
else
doPlayerSendCancel(cid, "You do not have enough money to buy all the blessings!")
break
end
end
end
if fail == 5 then
doPlayerSendCancel(cid, "You already have all the blessings!")
end
return TRUE
end
 
Script is good, I have same problem (TFS 0.2.11pl2), tried probably 5 scripts, no one of them worked, I think it's problem in PlayerDeath
 
No errors?

As far as 0.2.11 functions are concerned, i have no clue what they are but try to add in doCreatureSetDropLoot(cid, false) in before doPlayerAddBlessing.
 
Last edited:
This is a script for 0.3.6 that I made, but try if it works at your server:
Lua:
function onSay(cid, words, param)

		if		doPlayerRemoveMoney(cid, 50000) then
			doPlayerAddBlessing(cid, 1, 2, 3, 4, 5)
elseif
				getPlayerBlessing(cid) >= 1 then
					doSendPlayerCancel(cid, "You have already been blessed!")
				doSendMagicEffect(getCreaturePosition(cid), 2)
else
			doPlayerSendCancel(cid, "You don't have enough money")
				doSendMagicEffect(getCreaturePosition(cid), 2)
		end
return TRUE
end

EDIT: I have not put effect when you succesfully buy it, but if you write it and you get no effect, then it means it worked, if you GOT effect, that means you already had the blessing or cant afford it.
 
This is a script for 0.3.6 that I made, but try if it works at your server:
Lua:
function onSay(cid, words, param)

		if		doPlayerRemoveMoney(cid, 50000) then
			doPlayerAddBlessing(cid, 1, 2, 3, 4, 5)
elseif
				getPlayerBlessing(cid) >= 1 then
					doSendPlayerCancel(cid, "You have already been blessed!")
				doSendMagicEffect(getCreaturePosition(cid), 2)
else
			doPlayerSendCancel(cid, "You don't have enough money")
				doSendMagicEffect(getCreaturePosition(cid), 2)
		end
return TRUE
end

EDIT: I have not put effect when you succesfully buy it, but if you write it and you get no effect, then it means it worked, if you GOT effect, that means you already had the blessing or cant afford it.

Your tabbing is absolutely horrible...
 
Back
Top