Jump to content

Recommended Posts

The title basically explains my problem.

I'm trying to make a character that uses the caves as the base of her operations, and trying to make a sinkhole spawn next to her when you start the game. However, with my current code, the sinkhole spawns every time you load the game.

function SpawnSinkhole(player)	if player.prefab == "wubii" then        local x, y, z = player.Transform:GetWorldPosition()	    local sinkhole = GLOBAL.SpawnPrefab("cave_entrance")        sinkhole.Transform:SetPosition( x, y, z - 3)		endendAddSimPostInit(SpawnSinkhole)



I'm starting to get the idea that I am bad at modding. Edited by pikafan8

Well you're telling it  "every time the world loads"  which happens when you load a game.  So inside your call you need to do some checks to see if you really want to spawn or not.  Just set a tag on the world after you spawn a sinkhole and if that tag is set dont spawn another.  Or some other way you choose.  

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