Tag.xml
<talkaction words="!changesex;/changesex;/changender" script="arquivo.lua" />
Arquivo.lua
function onSay(cid, words, param, channel)
local config = {costPremiumDays = 2}
if(getPlayerSex(cid) >= 2) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot change your gender.")
return TRUE
end
if(getPlayerPremiumDays(cid) < config.costPremiumDays) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, not enough premium time- changing gender costs " .. config.costPremiumDays .. " days.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
end
if(getPlayerPremiumDays(cid) < 65535) then
doPlayerAddPremiumDays(cid, -config.costPremiumDays)
end
if(getPlayerSex(cid) == PLAYERSEX_FEMALE) then
doPlayerSetSex(cid, PLAYERSEX_MALE)
else
doPlayerSetSex(cid, PLAYERSEX_FEMALE)
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender and lost " .. config.costPremiumDays .. " days of premium time.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
return TRUE
end









info
Grupo: Visconde
Registrado: 28/07/12
Posts: 273
Reputação: +26
Char no Tibia: Kisame of Tenebra
Gostaria de um comando que quando o player usar !changesex ele troca de sexo.
Exemplo : Sou male e cansei das outfits !changesex e mudo para female e vise versa.
Agradeço deis de já.