ID:176507
 
How would i make it possible to if you click the verb Pickpocket that you steal a random item from the other player next to you?
mob/verb/Pickpocket(mob/M in oview(1)
if(!M.contents.len) return
var/atom/movable/A = pick(M.contents)
A.Move(usr)
Koolguy900095 wrote:
How would i make it possible to if you click the verb Pickpocket that you steal a random item from the other player next to you?

mob/verb/Pickpocket(mob/M in oview(1))  // Look for a mob 1 tile away
if(M.contents.len) // Make sure that the victim has item(s)
var/atom/A = pick(M.contents) // Pick a random item from their inventory
src.contents += A // Add the stolen item to your own inventory
src << "You stole [A.name] from [M.name]!"
Hope that helps. :)