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

Lava Titan

Developer
Joined
Jul 25, 2009
Messages
1,529
Solutions
1
Reaction score
85
Location
Portugal
Sup guys,

Does anyone know why we cant do look on players?

Im using a compiled server and im using tfs creaturescripts and when i go on my server and click look on players it doesnt work...

Does anyone know whats the problem?
 
Post any onLook creaturescripts you have, if you can't fix them yourself. You might be missing a 'return true'.
 
Server Client: 8.60

Login.lua from 854

Lua:
local config = {
	loginMessage = getConfigValue('loginMessage')
}

function onLogin(cid)
	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 lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		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
	
    setPlayerStorageValue(cid, 14755, -1)
	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "TopFrags")
	registerCreatureEvent(cid, "GuildMotd")
	registerCreatureEvent(cid, "Idle")
	registerCreatureEvent(cid, "SkullCheck")
	registerCreatureEvent(cid, "ReportBug")
    registerCreatureEvent(cid, "PlayerDeath")
	registerCreatureEvent(cid, "advance")
	registerCreatureEvent(cid, "expRate")
	registerCreatureEvent(cid, "BountyHunter")
	registerCreatureEvent(cid, "PWNED")
	registerCreatureEvent(cid, "questLook")
	return true
end

creaturescripts.xml

PHP:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
	<event type="login" name="PlayerLogin" event="script" value="login.lua"/>
	
    <event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
	<event type="receivemail" name="Mail" event="script" value="mail.lua"/>
	<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>

	<event type="think" name="Idle" event="script" value="idle.lua"/>
	<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>
	
	<event type="advance" name="Advance" event="script" value="advance.lua"/>
	
	<event type="kill" name="TopFrags" event="script" value="frags/topfrags.lua"/>
	<event type="login" name="expRate" event="script" value="extraExp.lua"/>
	<event type="preparedeath" name="PWNED" event="script" value="owned.lua"/>
    <event type="kill" name="BountyHunter" script="bh/kill.lua"/>
	<event type="look" name="questLook" event="script" value="quest.lua"/>
</creaturescripts>

the only script onLook i have its this :

Lua:
function onLook(cid, thing, position, lookDistance)
local quests = {2272, 2263, 2307, 2264, 7425, 7959, 8980, 8926, 2350, 2538, 8927, 6531, 5927, 7735, 7443, 7439, 2357, 2127, 2131, 2299, 2122, 2283, 11113, 11387}
local completed = {}
	if isPlayer(thing.uid) then
		for i = 1, #quests do
			if getPlayerStorageValue(thing.uid, quests[i]) > 0 then
				table.insert(completed, 1)
			end
		end
		doPlayerSetSpecialDescription(thing.uid, (getPlayerSex(thing.uid) == 0 and ".\nShe" or ".\nHe") .. " has completed ".. #completed .. "/" .. #quests .. " quests")
		doPlayerSendTextMessage(cid, 27, getPlayerName(thing.uid) .. " has completed " .. #completed .. "/" .. #quests .. " quests.")
	end
return true
end
 
Its fixed xd, i remember that since i reseted database i had to rewrite the rep sql query on database to the mod works, now i can look at other players normaly, thanks xd
 
Back
Top