local male = 9098 -- Change to a unique ID that isnt in use.
local female = 8908 -- Change to a unuique ID that isnt in use. Cant be the same has male.
local playerPos = getCreaturePosition(cid)
local lookdir = getPlayerLookDir(cid)
-- end config --
function onUse(cid, item, frompos, item2, topos)
if item.uid == male and getPlayerSex(cid) == 0 then
if lookdir == 0 then
doTeleportThing(cid, playerPos.y -= 1)
doPlayerSendCancel(cid, "Only males can enter this door.")
elseif lookdir == 1 then
doTeleportThing(cid, playerPos.x -= 1)
doPlayerSendCancel(cid, "Only males can enter this door.")
elseif lookdir == 2 then
doTeleportThing(cid, playerPos.y += 1)
doPlayerSendCancel(cid, "Only males can enter this door.")
elseif lookdir == 3 then
doTeleportThing(cid, playerPos.x += 1)
doPlayerSendCancel(cid, "Only males can enter this door.")
end
elseif item.uid == female and getPlayerSex(cid) == 1 then
if lookdir == 0 then
doTeleportThing(cid, playerPos.y -= 1)
doPlayerSendCancel(cid, "Only females can enter this door.")
elseif lookdir == 1 then
doTeleportThing(cid, playerPos.x -= 1)
doPlayerSendCancel(cid, "Only females can enter this door.")
elseif lookdir == 2 then
doTeleportThing(cid, playerPos.y += 1)
doPlayerSendCancel(cid, "Only females can enter this door.")
elseif lookdir == 3 then
doTeleportThing(cid, playerPos.x += 1)
doPlayerSendCancel(cid, "Only females can enter this door.")
end
return TRUE
end