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:
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