• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Bless command

George00

propro
Joined
Jan 11, 2014
Messages
163
Solutions
1
Reaction score
10
Location
propro
I am currently using this bless command but i get an error do you guys know why

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_MAGIC_RED)
end
else
doCreatureSay(cid, "You do not have enough money to buy all the blessings or cap/slot to get the rest of money!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
break
end
end
end
if fail == 5 then
doPlayerSendCancel(cid, "You already have all the blessings!")
end
return TRUE
end
[/code]

11/07/2014 21:42:53] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/bless.lua:35: unexpected symbol near '['
[11/07/2014 21:42:53] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/bless.lua)
[11/07/2014 21:42:53] data/talkactions/scripts/bless.lua:35: unexpected symbol near '['
 
I am currently using this bless command but i get an error do you guys know why

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_MAGIC_RED)
end
else
doCreatureSay(cid, "You do not have enough money to buy all the blessings or cap/slot to get the rest of money!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
break
end
end
end
if fail == 5 then
doPlayerSendCancel(cid, "You already have all the blessings!")
end
return TRUE
end
[/code]

11/07/2014 21:42:53] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/bless.lua:35: unexpected symbol near '['
[11/07/2014 21:42:53] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/bless.lua)
[11/07/2014 21:42:53] data/talkactions/scripts/bless.lua:35: unexpected symbol near '['
Use code tags when you post scripts

[ code]
your script
[/code]
 
Back
Top