ID:2053006
 
(See the best response by FKI.)
Code:
var
global
ManaPotionsList[0]

world
New()
for(T in (typesof(/obj/Items/Mana_Potions) - /obj/Items/Mana_Potions))
ManaPotionsList += new T

creating = input("Which Mana Potion?") in ManaPotionsList

usr.contents += new creating
//vs.
usr.contents += new/obj/Items/Full_Mana_Potion


Problem description:

For some reason, when trying to create a new Full Mana Potion, using the first way doesn't work, even though in the runtime error it says the correct path.

runtime error: Cannot create objects of type /obj/Items/Mana_Potions/Full_Mana_Potion.
proc name: Create (/mob/GM/verb/Create)
usr: (src)
src: YuuHkiSay (/mob/Player)
src.loc: the grass (32,82,1) (/turf/ground/grass)
call stack:
YuuHkiSay (/mob/Player): Create()
Best response
First of all, you are adding object instances to the global list, not type paths. So when you select a potion to create, you are getting an object back, when what you want is the type of object to create.

Also, your world/New() should use the supercall ..() proc.

Edit: Or alternatively, you could do:

usr.contents += new creating.type


Make sure creating is typecasted as an object at least.
Adding a new() item to usr.contents is a backwards way to go about it, because you can pass the new location for the object in new() itself.

new/obj/Items/Full_Mana_Potion(usr)

It's way more efficient, and easier to read the code, when you pass the new location as an argument.