• 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 [TFS1.2] Problem with the script - sex change doll

Haskys

Member
Joined
Jul 19, 2019
Messages
97
Reaction score
8
Location
Poland
Hello,


My sex change script only works one way. When changing from boy to girl everything is ok - sex of the revenge, the doll disappears. However, when trying to change from girl to boy nothing happens - sex does not change, the doll does not disappear.


Can anyone help?

Lua:
function onUse(cid, item, fromPosition, item2, toPosition)
local sexs = {
[1] = {s=1},
[1] = {s=0}
}
local sex = sexs[getPlayerSex(cid)]
    if sex then
        doPlayerSetSex(cid,sex.s)
        doRemoveItem(item.uid,1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Your sex has been changed")
    end
return true
end

Haskys
 
Solution
Hello,


My sex change script only works one way. When changing from boy to girl everything is ok - sex of the revenge, the doll disappears. However, when trying to change from girl to boy nothing happens - sex does not change, the doll does not disappear.


Can anyone help?

Lua:
function onUse(cid, item, fromPosition, item2, toPosition)
local sexs = {
[1] = {s=1},
[1] = {s=0}
}
local sex = sexs[getPlayerSex(cid)]
    if sex then
        doPlayerSetSex(cid,sex.s)
        doRemoveItem(item.uid,1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Your sex has been changed")
    end
return true
end

Haskys
Hi,
Your sexs table is not right, u have 2 values to índex 1. Im not sure, but should be:
Lua:
local sexs...
Hello,


My sex change script only works one way. When changing from boy to girl everything is ok - sex of the revenge, the doll disappears. However, when trying to change from girl to boy nothing happens - sex does not change, the doll does not disappear.


Can anyone help?

Lua:
function onUse(cid, item, fromPosition, item2, toPosition)
local sexs = {
[1] = {s=1},
[1] = {s=0}
}
local sex = sexs[getPlayerSex(cid)]
    if sex then
        doPlayerSetSex(cid,sex.s)
        doRemoveItem(item.uid,1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Your sex has been changed")
    end
return true
end

Haskys
Hi,
Your sexs table is not right, u have 2 values to índex 1. Im not sure, but should be:
Lua:
local sexs ={[0] = {s=1}, [1] = {s=0}}
Im not sure about sex values, i think is 0 and 1.
 
Solution
Back
Top