ID:156009
 
As the title says how would i go about this here's an example.

Let's just say i want to a buy a rug and it says how many would you like to buy i put in x amount then i receive x amount in my inventory? I believe it would done by input I'm quite sure of that. But would i need the use of isnum etc?

Edit:

Right this could be incredibly wrong but its how i thought it may go? Also not to sure how i would then give x amount of the item after inputting.

mob/verb/giveme()
x = input("X","X",isnum(x))
For getting number input from the user, you will want to use <code>input()</code> in this way.

var/num = input(src, "Body text", "Title text") as num


There are many ways on giving someone items, but you generally will want to use a loop of some sort.

for(var/i = 1 to num)
new /obj/item (src)


If you have anything that prevents players from carrying too many items, or carrying specific items, you will have to validate before doing this.