pikafan8 Posted October 25, 2014 Share Posted October 25, 2014 (edited) 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 October 25, 2014 by pikafan8 Link to comment https://forums.kleientertainment.com/forums/topic/42789-need-help-on-making-a-sinkhole-spawn-next-to-character-on-world-generation/ Share on other sites More sharing options...
seronis Posted October 25, 2014 Share Posted October 25, 2014 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. Link to comment https://forums.kleientertainment.com/forums/topic/42789-need-help-on-making-a-sinkhole-spawn-next-to-character-on-world-generation/#findComment-556958 Share on other sites More sharing options...
chromiumboy Posted October 26, 2014 Share Posted October 26, 2014 (edited) Alternatively put an 'if then' which checks to see if its day 1 and time zero. See the trigger for maxwells speech for example. Edited October 26, 2014 by chromiumboy Link to comment https://forums.kleientertainment.com/forums/topic/42789-need-help-on-making-a-sinkhole-spawn-next-to-character-on-world-generation/#findComment-557421 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