• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Windows Change Sex command

kozmo

Member
Joined
Jan 30, 2009
Messages
433
Solutions
2
Reaction score
22
Hey otland so today i am having a problem when players
want to change there sex it seems it is taking all there
addons when changed. Of course i would like to get this fixed right away.
Also in a perfect world i would also like it to take gold not premium days.

Code:
local premiumDaysCost = 3

function onSay(player, words, param)
    if player:getGroup():getAccess() then
        player:setSex(player:getSex() == PLAYERSEX_FEMALE and PLAYERSEX_MALE or PLAYERSEX_FEMALE)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have changed your sex.")
        return false
    end

    if player:getPremiumDays() >= premiumDaysCost then
        player:removePremiumDays(premiumDaysCost)
        player:setSex(player:getSex() == PLAYERSEX_FEMALE and PLAYERSEX_MALE or PLAYERSEX_FEMALE)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have changed your sex for ".. premiumDaysCost .." days of your premium account.")
    else
        player:sendCancelMessage("You do not have enough premium days, changing sex costs ".. premiumDaysCost .." days of your premium account.")
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
    end
    return false
end
 
Back
Top