Jump to content

'workable' is a NIL value


Doomgoat

Recommended Posts

In my mod, every time another player tries to join my game with the mod enabled, it will freeze their game or give them an error that 'workable' is a NIL value. I was not having this issue before and all of a sudden it decided to start happening. 

 

Here is my code:

-- This will execute once after rabbithole initializeslocal function rabbithole_postinit(inst)    -- local dig_up function    local function dig_up(inst, chopper)    	if inst.components.spawner:IsOccupied() then			inst.components.lootdropper:SpawnLootPrefab("manrabbit_tail")	    	end    	inst:Remove()    end    -- This replaces the old dig_up function with the new one above    inst.components.workable:SetOnFinishCallback(dig_up)end-- Adds the above function to be executed after rabbithole is initializedAddPrefabPostInit("rabbithole", rabbithole_postinit)

any help would be amazing!

Link to comment
Share on other sites

@Doomgoat, if this mod is for Don't Starve Together you should use the proper section.

 

If the answer to the above is that it is for that game, then you only should be running component commands on the server.

 

Add the following code right after your local function line.

 

if not GLOBAL.TheWorld.ismastersim then

return

end 

Link to comment
Share on other sites

@Doomgoat, if this mod is for Don't Starve Together you should use the proper section.

 

If the answer to the above is that it is for that game, then you only should be running component commands on the server.

 

Add the following code right after your local function line.

 

if not GLOBAL.TheWorld.ismastersim then

return

end 

 

You are a miracle worker! Thank you so much!!! And i'm very sorry for posting this thread in the wrong section, please pardon me as I am new here! :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...