M_Balthazar_M Posted May 27, 2022 Share Posted May 27, 2022 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 end but I cannot find a command to spawn the mushroom. Any idea? Link to comment Share on other sites More sharing options...
Bumber64 Posted May 27, 2022 Share Posted May 27, 2022 SpawnPrefab("red_mushroom").Transform:SetPosition(x, y, z) Link to comment Share on other sites More sharing options...
M_Balthazar_M Posted June 5, 2022 Author Share Posted June 5, 2022 Thanks!!! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now