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

Error ..! Some 1 Can Help :D

fewdox

New Member
Joined
Jan 9, 2010
Messages
244
Reaction score
2
Location
192.168.1.2 else try 127.0.0.1
Getting error in script ...

ERROR :
[01/08/2010 20:30:41] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/aolbuyer.lua:28: '<eof>' expected near 'end'
[01/08/2010 20:30:41] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/aolbuyer.lua)
[01/08/2010 20:30:41] data/creaturescripts/scripts/aolbuyer.lua:28: '<eof>' expected near 'end'

Script :
local config = {
storage = 3500,
price = 10000;
};

function onLogin(cid)
local storage, price = 3500, 10000 --config here
if getPlayerStorageValue(cid, (storage)) == 0 or getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2173 then
return true
end
if doPlayerBuyItem(cid, 2173, 1, price, 1) then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have bought an amulet of loss automatically.")
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"WARNING: You do not have enough money to buy an amulet of loss.")
end
return true
end

if getPlayerMoney(cid) < (config.price) then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"WARNING: You do not have enough money to buy an amulet of loss.")
return true
end

doPlayerRemoveMoney(cid, (config.price))
doPlayerAddItem(cid,2173,1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought an amulet of loss automatically.")
return true
end
 
Here it is, but I don't think your script will execute normally. I corrected what you requested here to correct, it has the same effect than the original one, but your script is a little bit messy. But anyway, you should have your ideas... Here it go:

PHP:
local config = {price=10000, storage=3500}

function onLogin(cid)
local storage, price = 3500, 10000 --config here
if getPlayerStorageValue(cid, (storage)) == 0 or getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2173 then
return true
end
if doPlayerBuyItem(cid, 2173, 1, price, 1) then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Yo u have bought an amulet of loss automatically.")
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"WARNING: You do not have enough money to buy an amulet of loss.")
end

if getPlayerMoney(cid) < (config.price) then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"WARNING: You do not have enough money to buy an amulet of loss.")
return true
end

doPlayerRemoveMoney(cid, (config.price))
doPlayerAddItem(cid,2173,1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought an amulet of loss automatically.")
return true
end
 
Back
Top