ID:144590
 
Code:
    scroll
verb
description()
usr << "A Scroll For Summoning Items (Random)"
Use()
var B = rand(1,3) // rolls a dice 1 through 3
switch(B)
if (1)
var/obj/tv/J = new (locate(usr)); get(J)
if (2)
var/obj/armchair/J = new (locate(usr)); get(J)
if (3)
var/obj/scroll/J = new (locate(usr)); get(J)


Problem description: It wont let me use switch(B) to make a random dice roll to spawn an item inside the inventory, please help and tell me why i get these error messages: 89:error::invalid expression and 88:error:rand:undefined proc
And now when i use the new code i get 4 errors saying my indentation is inconsistent, this is my new code here.

    scroll
verb
description()
usr << "A Scroll For Summoning Items"
Use()
var/a=pick(/obj/tv, /obj/armchair, /obj/scroll)
var/j=new a
Get(j)
del(src)



Somebody tell me how to indent this -_-

Your indentation is all messed up, that's the problem. But there's a far easier way of doing what you want to do:

scroll
verb
Use()
var/a=pick(/obj/tv, /obj/armchair, /obj/scroll)
var/j=new a
Get(j)
In response to Jp
Thanks alot
In response to Animay3
Although even with the code you posted i still cant get the indentation correct, I wish it would be easier :(
In response to Animay3
Try not copy and pasting.
In response to A.T.H.K
I did.