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

Solved {{0.3.6}}!GoHouse Command not working?

xYzPrototype

Just a standard member
Joined
Feb 27, 2015
Messages
49
Reaction score
4
Location
EUW
Hello again, so I found this gohouse command here, tweaked it a bit to remove some affects I didn't want, and it's not working. It's never worked, all it does is Teleport you to the same tile that the player is standing and says 'Bye'. Can someone diagnose the problem in my script please? I don't know how to fix it.
Code:
function onSay(cid, words, param, channel)
local storage = 2313
local playerPos = getCreaturePosition(cid)
if exhaustion.check(cid, storage) ~= false then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You must wait ' .. exhaustion.get(cid, storage) .. ' seconds')
end
if getHouseByPlayerGUID(getPlayerGUID(cid)) then
doTeleportThing(cid, getHouseInfo(getHouseByPlayerGUID(getPlayerGUID(cid))).entry)
doSendMagicEffect(playerPos, CONST_ME_TELEPORT)
doSendAnimatedText(playerPos, 'Bye!', TEXTCOLOR_GREEN)
exhaustion.set(cid, storage, 10)
return true
end

if isPlayerPzLocked(cid) or getCreatureCondition(cid, CONDITION_INFIGHT) then
doSendAnimatedText(playerPos, 'PZ Locked!', TEXTCOLOR_RED)
exhaustion.set(cid, storage, 10)
end

if getHouseByPlayerGUID(getPlayerGUID(cid)) ~= nil then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You dont own a house!")
end
return true
end

Or at least tell me when I need to add elsewhere so this works? I can only find scripts very similar to this and all of them do the same thing

Thank you
 
Last edited:
This is a movement script that teleports you to the entrance of your house. It's made for for 1.0, maybe it helps, I dno.
Code:
<movevent event="StepIn" actionid="25551" script="houseTeleport.lua" />
Code:
function onStepIn(cid, item, position, fromPosition)
    local player = Player(cid)
    if not player then
        return true
    end

    local house = player:getHouse()
    if not house then
        player:teleportTo(fromPosition, true)
        fromPosition:sendMagicEffect(CONST_ME_TELEPORT)
        return true
    end

    player:teleportTo(house:getExitPosition())
    player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
    return true
end
 
Back
Top