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

Action [TFS 1.1] - Sex change Doll

FLE

Member
Joined
Oct 5, 2008
Messages
422
Reaction score
24
Location
Vancouver Canada
This is a simple script you use a doll (or xxxx item) and it changes your sex to the opposite sex.

I have a sex changer npc who sells this feature and I turned it into a doll for you guys I guess lol.

feel free too post improvements and suggestions!

actions.xml -
Code:
<action itemid="xxxx" script="martin/sex doll.lua"/>
Sex changer.lua -
Code:
function onUse (player , item , fromPosition , itemEx , toPosition , isHotkey)
do player:setSex (player:getSex () == 1 and 0 or 1)
player:sendTextMessage (MESSAGE_STATUS_CONSOLE_BLUE ,  'Your sex change was successful!')
player:getPosition():sendMagicEffect (CONST_ME_SOUND_BLUE)
item:remove (1)
end
return  true
end

enjoy~
-Martin
 
Last edited:
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    player:setSex(player:getSex() == PLAYERSEX_MALE and PLAYERSEX_FEMALE or PLAYERSEX_MALE)
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Your sex change was successful!')
    player:getPosition():sendMagicEffect(CONST_ME_SOUND_BLUE)
    player:save()
    item:remove(1)
    return true
end

Remove the do and end functions, use the constants insted of the integers it resembles, skip all the spaces you used aswell - makes the code look weird :p
Also remember to save the character, otherwise if the player gets kicked for some reason (a save is not done yet) the changes will be reverted.
 
Back
Top