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

TFS 0.X How to Block Clicking Backpack on House Door?

willks123

New Member
Joined
Dec 31, 2012
Messages
65
Reaction score
2
My server is X 2 - 0.7 - Version 7.72

I have a House Protection script, but if the player puts a Backpack on the Door to Make Runes, anyone can open the Backpack and take what's inside.

How do I make it so that only those who are invited to the house can click on backpacks or move items inside the house?

My houseprotection.lua:
Lua:
local function isInvited(houseId, playerName)
    if(string.find(string.lower(getHouseAccessList(houseId, 0x100)), playerName) or string.find(string.lower(getHouseAccessList(houseId, 0x101)), playerName)) then
        return true
    end

    return false
end

function onMoveItem(moveItem, frompos, position, cid)
    if((getPlayerGroupId(cid) < 6) and (getTileInfo(position).house) and (getHouseOwner(getHouseFromPos(position)) ~= getPlayerGUID(cid)) and (not isInvited(getHouseFromPos(position), string.lower(getCreatureName(cid))))) then
        doPlayerSendCancel(cid, "You cannot throw there.")
    else
        return true
    end
end
 
Back
Top