TheJCsurvivor Posted March 14, 2015 Share Posted March 14, 2015 So, I'm trying to create a mod where the player character will poop after eating. What I'm trying to do here is check if the eating animation was played, if it's true then spawn a poop prefab in the player's location. Here's what I got so far... Apologies for my stupidity. This is the first time I've encountered this type of problem and I've never seen a single tutorial covering this subject. Also exhausted trying to find some answers in the web. [codesyntax]function PoopAfterEating(player)if (inst.AnimState:IsPlaying("eat") == true) thenlocal x, y, z = player.Transform:GetWorldPosition()local poo = GLOBAL.SpawnPrefab("common/inventory/poop")poo.Transform:SetPosition( x, y, z )endend AddSimPostInit(PoopAfterEating)[/codesyntax] It always sends an error about a 'nil value'. I tried changing this code, turning it upside down, etc but nothing worked. I even tried to make this an entirely new EventHandler at one point. So, yeah, any ideas on how to make this work? Link to comment Share on other sites More sharing options...
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.