{"action":"created","issue":{"url":"https://api.github.com/repos/otland/forgottenserver/issues/1257","labels_url":"https://api.github.com/repos/otland/forgottenserver/issues/1257/labels{/name}","comments_url":"https://api.github.com/repos/otland/forgottenserver/issues/1257/comments","events_url":"https://api.github.com/repos/otland/forgottenserver/issues/1257/events","html_url":"https://github.com/otland/forgottenserver/issues/1257","id":64870640,"number":1257,"title":"Item function \"moveTo\"","user":{"login":"WibbenZ","id":6361370,"avatar_url":"https://avatars.githubusercontent.com/u/6361370?v=3","gravatar_id":"","url":"https://api.github.com/users/WibbenZ","html_url":"https://github.com/WibbenZ","followers_url":"https://api.github.com/users/WibbenZ/followers","following_url":"https://api.github.com/users/WibbenZ/following{/other_user}","gists_url":"https://api.github.com/users/WibbenZ/gists{/gist_id}","starred_url":"https://api.github.com/users/WibbenZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WibbenZ/subscriptions","organizations_url":"https://api.github.com/users/WibbenZ/orgs","repos_url":"https://api.github.com/users/WibbenZ/repos","events_url":"https://api.github.com/users/WibbenZ/events{/privacy}","received_events_url":"https://api.github.com/users/WibbenZ/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/otland/forgottenserver/labels/invalid","name":"invalid","color":"e6e6e6"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-27T23:28:34Z","updated_at":"2015-03-28T01:12:36Z","closed_at":null,"body":"Seems like the function is bugged.\r\nThe script works like this:\r\nMove the item to position X, if the item is not valid it will be moved back to the player.\r\n\r\nIf I move it from my backpck to the position the item does not get moved, it stays at the position.\r\nBut if I have move the item from the ground to the position the item gets moved back to the players backpack.\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/10106173-item-function-moveto?utm_campaign=plugin&utm_content=tracker%2F392151&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F392151&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/otland/forgottenserver/issues/comments/87136810","html_url":"https://github.com/otland/forgottenserver/issues/1257#issuecomment-87136810","issue_url":"https://api.github.com/repos/otland/forgottenserver/issues/1257","id":87136810,"user":{"login":"WibbenZ","id":6361370,"avatar_url":"https://avatars.githubusercontent.com/u/6361370?v=3","gravatar_id":"","url":"https://api.github.com/users/WibbenZ","html_url":"https://github.com/WibbenZ","followers_url":"https://api.github.com/users/WibbenZ/followers","following_url":"https://api.github.com/users/WibbenZ/following{/other_user}","gists_url":"https://api.github.com/users/WibbenZ/gists{/gist_id}","starred_url":"https://api.github.com/users/WibbenZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WibbenZ/subscriptions","organizations_url":"https://api.github.com/users/WibbenZ/orgs","repos_url":"https://api.github.com/users/WibbenZ/repos","events_url":"https://api.github.com/users/WibbenZ/events{/privacy}","received_events_url":"https://api.github.com/users/WibbenZ/received_events","type":"User","site_admin":false},"created_at":"2015-03-28T01:12:36Z","updated_at":"2015-03-28T01:12:36Z","body":"Dident see any point in uploading it.\r\nIll do it tomorow then.\r\n\r\nThe validation is to find the item in the array to get the price of it.\r\nIf it found a price the item is removed and money is added to the player.\r\nThe item can be any item, ex a shovel that is on the ground or in your backpack.\r\nAs long as the item id is in the list it will work.\r\n\r\nUsing the item userdata in the player:moveitem? In the player events.\r\nIt is then called to a function that handles the above.\r\n\r\nThe script works I always get the \"you cannot sell this item...\" when I put an invalid item on that position.\r\nBut I only get the item back if I move it from a ground tile. As I explained, if I move it from my backpack the item gets sent to the position(as it should) I get the message that I cant sell that item but the item isent moved back to the player.\r\n\r\nSo to test it use the event function and this:\r\nitem:moveTo(self)\r\nIf you now have the item in a backpack it wont be sent back. It will be added to the ground to where you moved it.\r\nBut if the item already is on the ground the item will be moved to your backpack.\r\nHope that explained it, otherwise ill tell you more and show you the script tomorow when im at my computer."}}