• 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 pist off...

WibbenZ

Global Moderator
Staff member
Global Moderator
Joined
Oct 16, 2008
Messages
6,383
Solutions
229
Reaction score
1,521
Location
Sweden
Look at this code I tryd like 10 times but it just keep giving me error >.<

LUA:
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 been blessed')
					doPlayerSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    else
		for i = 1,5 do
        if doPlayerAddBlessing(cid, i) == TRUE then
				doPlayerRemoveMoney(cid, 25000) 
                   doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
    else
            doPlayerSendCancel(cid, "You need 25 crystal coin to get blessed!")
			doPlayerSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
	end    
return 1
    end
	end

error:
Code:
[11/06/2010 20:32:50] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/bless.lua:16: 'end' expected (to close 'function' at line 1) near '<eof>'
[11/06/2010 20:32:50] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/bless.lua)
[11/06/2010 20:32:50] data/talkactions/scripts/bless.lua:16: 'end' expected (to close 'function' at line 1) near '<eof>'
[11/06/2010 20:32:50] Reloaded talk actions.

0.3.6_DEV but and old one soo I think its normal 3.6 now ^^
rep++
 
LUA:
  function onSay(cid, words, param, channel)
        if getPlayerBlessing(cid, 5) == FALSE then
                if getPlayerMoney(cid) >= 250000 then
                        for i = 1,5 do
                                doPlayerAddBlessing(cid, i)
                        end
                        doSendMagicEffect(getCreaturePosition(cid), 39)
                        doPlayerRemoveMoney(cid, 250000)
                        doPlayerSendTextMessage(cid, 22, "You have been blessed by the gods!")
                else
                        doPlayerSendCancel(cid, "You don't have enough money.")
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
                end
        else
                doPlayerSendCancel(cid, "You have already been blessed.")
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        end
return true
end
 
Back
Top