• 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 Creaturescript (Description Player)

Joined
May 23, 2010
Messages
185
Reaction score
23
Hi guys, how are you?

I having some problems with a script, i got a storage but the description on my nick don't work.
I don't have any errors on console, but the script doesn't work, here:

look.lua

Code:
function onLogin(cid)
 
local storage = {
Orc_Guild = 40840,
Elf_Guild = 40841,
Minotaur_Guild = 40842,
Dwarf_Guild = 40843
}

if getPlayerStorageValue(cid, storage.Orc_Guild) == 1 then
doPlayerSetSpecialDescription(cid," Member of Orc Guild")
elseif getPlayerStorageValue(cid, storage.Elf_Guild) == 1 then
doPlayerSetSpecialDescription(cid," Member of Elf Guild")
elseif getPlayerStorageValue(cid, storage.Minotaur_Guild) == 1 then
doPlayerSetSpecialDescription(cid," Member of Minotaur Guild")
elseif getPlayerStorageValue(cid, storage.Dwarf_Guild) == 1 then
doPlayerSetSpecialDescription(cid," Member of Dwarf Guild")
end
return TRUE
end

creature.xml
Code:
<event type="login" name="lookLogin" event="script" value="look.lua"/>

login.lua
Code:
registerCreatureEvent(cid, "lookLogin")
 
LUA:
local t = {
	[40840] = 'Orc',
	[40841] = 'Elf',
	[40842] = 'Minotaur',
	[40843] = 'Dwarf'
}
function onLook(cid, thing, position, lookDistance)
	if isPlayer(thing.uid) then
		for k, v in pairs(t) do
			if getPlayerStorageValue(thing.uid, k) == 1 then
				return doPlayerSetSpecialDescription(thing.uid, ' Member of ' .. v .. ' Guild')
			end
		end
	end
	return true
end
Code:
	<event type="look" name="lookLogin" event="script" value="look.lua"/>
 
@Cykotitan

Hi, thanks for help me, but i still have the error. I use a talkaction to test storages,

f
Code:
unction onSay(cid, words, param)
if getPlayerStorageValue(cid,40840) ~= 1 then
setPlayerStorageValue(cid,40840,1)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você já tem a storage.")
end
end

I tested the Orc Storage (40840), but look at the imagem, nothing happen:

imagemyfi.png
 
Back
Top