Schulliya Posted May 6, 2021 Share Posted May 6, 2021 Hi, I'm following this guide: https://demon7452.github.io/2016/11/24/DST-Mod-Tutorial.html When I run the script I get this error: attempt to index local 'player' (a nil value) The only things in the mod folder are modinfo.lua and modmain.lua, besides the icon Here's my code inside modmain.lua: function SpawnCreature(player) local x, y, z = player.Transform:GetWorldPosition() local creature = GLOBAL.SpawnPrefab("forest/animals/beefalo") creature.Transform:SetPosition( x, y, z ) end AddSimPostInit(SpawnCreature) Please help! Thank you. Link to comment https://forums.kleientertainment.com/forums/topic/129672-attempt-to-index-local-player-a-nil-value/ Share on other sites More sharing options...
Monti18 Posted May 6, 2021 Share Posted May 6, 2021 It looks like this guide is for Don't Starve and not Don't Starve Together. See this post why it doesn't work. You just need to use AddPlayerPostInit instead of AddSimPostInit. 1 Link to comment https://forums.kleientertainment.com/forums/topic/129672-attempt-to-index-local-player-a-nil-value/#findComment-1457039 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