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

Creaturescript: Login.lua error

Amiroslo

Excellent OT User
Joined
Jul 28, 2009
Messages
6,812
Solutions
6
Reaction score
822
Code:
[Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/login.lua:37: '<eof>' expected near 'elseif'
[Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/login.lua)
data/creaturescripts/scripts/login.lua:37: '<eof>' expected near 'elseif'
i cant find eof??

here is login.lua

im using tfs 0.3.6pl1

Code:
local config = {
	loginMessage = getConfigValue('loginMessage'),
	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)

local text = "- Welcome to ParadiseOT, here's a list of commands:\n!aol               -> Buy an amulet of loss\n!bless             -> Get blessed by the Gods\n!explorer             -> Get your help gear \n!spells            -> List of spells available\n!level             -> See your current level\n!frgas             -> Check your amount of kills\nCtrl+R             -> Report bugs to staff\n- Visit our webpage for a complete list of commands.\n//Paradise Staff"
local useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
local loss = getConfigValue('deathLostPercent')

	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local mapMark = {x=1002, y=903, z=7}
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			setPlayerStorageValue(cid,10010,0)
			doPlayerSendCancel(cid,"Your Killstreaks Have Been Reset")
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
			end
		else
			doPlayerPopupFYI(cid,"Welcome to ParadiseOT")
			doPlayerPopupFYI(cid,"After you choose your outfit and set your hotkeys..")
			doPlayerPopupFYI(cid,"Create Your Guild, Get Rady, Go For The Strike!")
			doPlayerAddMapMark(cid,mapMark,2,"TELEPORTER")
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
			end
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")
	
	registerCreatureEvent(cid, "Advance")
	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "AdvanceSave")
	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "AdvanceSave")
	registerCreatureEvent(cid, "zombieevent")
	registerCreatureEvent(cid, "VipCheck")
	registerCreatureEvent(cid, "TempleTeleporter")
	registerCreatureEvent(cid, "extraExp")
	registerCreatureEvent(cid, "forever amulet")
	registerCreatureEvent(cid, "skull amulet")
	registerCreatureEvent(cid, "charge amulet")
    registerCreatureEvent(cid,'SpellUp')
	registerCreatureEvent(cid, "ondeath")
    registerCreatureEvent(cid, "firstItems")
    registerCreatureEvent(cid, "onPrepareDeath")  
	registerCreatureEvent(cid, "rebirth")
	registerCreatureEvent(cid, "marry")
      registerCreatureEvent(cid, "InfoAdv")
      registerCreatureEvent(cid, "InfoDeath")
	registerCreatureEvent(cid, "Idle")
	if(config.useFragHandler) then
		registerCreatureEvent(cid, "SkullCheck")
	end
	return true
end
 
eof means end of file, how come you can't find the end of the file o.0?
anyways, you have at least 2 extra ends :p, remove them and the error will disappear.
 
Last edited:
i need this fast
how to fix it :S
Code:
[Error - CreatureScript Interface] 
data/creaturescripts/scripts/autobuyer.lua:onLogin
Description: 
data/lib/position.lua:6: attempt to index local 'firstPosition' (a boolean value)
stack traceback:
	data/lib/position.lua:6: in function 'getDistanceBetween'
	data/creaturescripts/scripts/autobuyer.lua:17: in function <data/creaturescripts/scripts/autobuyer.lua:12>
Admin Amir has logged out.

script
Code:
--#################################################
--### Scripted by PhoOwned                      ###
--### Contact: [email protected]                   ###
--###                                           ###
--### Auto AOL and / or Bless buyer after death ###
--### version: 1.0                              ###
--#################################################

local autoBlessStorage = 57927
local autoAOLStorage = 57928

function onLogin(cid)
	local templePosition = getTownTemplePosition(getPlayerTown(cid))
	local playerPosition = getThingPosition(cid)
	local fyi = {}
	local msg = {}
	if(getDistanceBetween(templePosition, playerPosition) <= 2) then
		if(getCreatureStorage(cid, autoAOLStorage) == 1 and getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 0) then
			if(doPlayerRemoveMoney(cid,10000)) then
				doPlayerAddItem(cid,2173,1)
				doCreatureSay(cid,'AOL',TALKTYPE_ORANGE_1)
				doSendMagicEffect(getThingPosition(cid),CONST_ME_BATS)
				table.insert(msg, 'You have bought Amulet of Loss!')
			else
				table.insert(fyi, 'You got no money for Amulet of Loss! It cost 1 crystal coin!')
			end
		end
		if(getCreatureStorage(cid, autoBlessStorage) == 1 and not getPlayerBlessing(cid,1)) then
			if(doPlayerRemoveMoney(cid,50000)) then
				for b=1,5 do
					doPlayerAddBlessing(cid,b)
				end
				doCreatureSay(cid,'BLESS',TALKTYPE_ORANGE_1)
				doSendMagicEffect(getThingPosition(cid),CONST_ME_HOLYDAMAGE)
				table.insert(msg, 'You have been blessed by the gods!')
			else
				table.insert(fyi, 'You got no money for Bless! It cost 5 crystal coin!')
			end
		end
	end
	if(#fyi > 0) then
		doPlayerPopupFYI(cid, table.concat(fyi, '\n'))
	end
	if(#msg > 0) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, table.concat(msg, '\n'))
	end
	if(#msg > 0 or #fyi > 0) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You can turn off auto buyer by commands:\n!aol off\n!bless off')
	end
	return true
end
 
Last edited:
Back
Top