Postado Agosto 25, 2014 10 anos Este é um post popular. Olá pessoal, para quem não sabe esse script funciona da seguinte maneira: você clica em um X item, e o player muda de sexo, se ele for male vira female, e vice-versa. Crie um arquivo com o nome change_sex.lua em actions/scripts e coloque isso dentro: change_sex.lua (TFS 1.0) Spoiler function onUse(cid, item, fromPosition, itemEx, toPosition, isHotkey) local player = Player(cid) if not player:isPzLocked() then player:setSex(player:getSex() == 1 and 0 or 1) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, 'You successfully changed sex!') player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) player:save() player:remove() end return true end change_sex.lua (TFS 1.1 e 1.2) Spoiler function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey) if not player:isPzLocked() then player:setSex(player:getSex() == 1 and 0 or 1) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, 'You successfully changed sex!') player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) item:remove(1) player:save() player:remove() end return true end E em actions.xml adcione a tag: <action itemid="XXXX" script="change_sex.lua"/> Basta colocar o id do item em XXXX acima, e prontinho. Bem simples né pessoal ?! Espero ter ajudado, abraços!
Postado Agosto 25, 2014 10 anos Autor @Superion, testa ai ... function onUse(cid, item, itemEx, toPosition) doPlayerSetSex(cid, getPlayerSex(cid) == 1 and 0 or 1) doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE , 'You successfully changed sex!') doSendMagicEffect(getCreaturePosition(cid), 35) doPlayerRemoveItem(cid, item.uid, 1) return true end
Postado Agosto 25, 2014 10 anos @Superion, testa ai ... function onUse(cid, item, itemEx, toPosition) if (getPlayerSex(cid) == 1) then doPlayerSetSex(cid, 0) else doPlayerSetSex(cid, 1) end doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE , 'You successfully changed sex!') doSendMagicEffect(getCreaturePosition(cid), 35) doPlayerRemoveItem(cid, item.uid, 1) return true end Funcinou de boa, eu agradeço cara. Mas não sei bem se isso é um Bug ou não, mas o Char só tróca de sexo quando reloga. De qualquer forma, REP+.
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.