Jump to content

Recommended Posts

look at already existing code and how it is done there. eg. the white chester or the insulated backpack.
And to spawn ice you can use the inst:WatchWorldState("isday", SpawnIceFunction). This function then is called at beginning of every day.

Link to comment
Share on other sites

8 hours ago, EscapeMan4 said:

Thank you, but now I'm encountering this problemimage.png.9c18dfcf3c396a1856bfcf47585768d2.png

I guess you copied "inst:WatchWorldState("isday", SpawnIceFunction)" without adding any code of your own?
Of course you have to define and write the SpawnIceFunction. The error message says, tha tis trying to call a function that is nil (not defined)

Link to comment
Share on other sites

12 hours ago, Serpens said:

I guess you copied "inst:WatchWorldState("isday", SpawnIceFunction)" without adding any code of your own?
Of course you have to define and write the SpawnIceFunction. The error message says, tha tis trying to call a function that is nil (not defined)

No this is the code set for spawning ice

 

local icee = SpawnPrefab("ice").Transform:SetPosition(inst.Transform:GetWorldPosition())
	inst:WatchWorldState("isday", icee)

 

Link to comment
Share on other sites

26 minutes ago, EscapeMan4 said:

No this is the code set for spawning ice

 

 

That's not a function, you need to do something like this
 

local function icee(inst)
		SpawnPrefab("ice").Transform:SetPosition(inst.Transform:GetWorldPosition())
 end

	inst:WatchWorldState("isday", icee)
Link to comment
Share on other sites

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
 Share

×
  • Create New...