Jump to content

Recommended Posts

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.

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...