Jump to content

Spawn something at player position

Recommended Posts

Hi, I was trying to make a mod that adds some kind of food that once eaten would spawn something.

In my case i was thinking about making a mushroom spawn (almost like planting it but instead you just eat an item)

I already made the item and all but cannot manage to spawn the mushroom, I think the code should be something like


local function OnEaten(inst, eater)

   local x, y, z = eater.Transform:GetWorldPosition()
   --Spawn("red_mushroom", x, y, z) --this is the line that bugs me


but I cannot find a command to spawn the mushroom. Any idea?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...