Jump to content

Character ability not working when enabling caves - Help please!


Recommended Posts

Helloooo, I once had a post asking help to change the sewing kit uses for my character mod and it did work! Although I noticed that if I choose my character mod and enable caves for my server, the game instantly crashes and gives me the following error;

jayden_bug_when_a_friend_plays_as_him_by

The character is totally playable when a server does not enable caves, and the programmed abilities also do work.

As it seems to point out the modmain lua as the source of the problem, here's the coding he currently has in it;

 

-- Sewing skills --
AddPrefabPostInit("sewing_kit", function(inst)
    inst.components.finiteuses:SetMaxUses( 2 * TUNING.SEWINGKIT_USES)
    inst.components.finiteuses:SetUses( 2 * TUNING.SEWINGKIT_USES)
	inst.components.sewing.repair_value = 2 * TUNING.SEWINGKIT_REPAIR_VALUE
end)

I do not understand why it crashes because of the caves, so I have no idea how to fix this ;_; Please any help would be amazing, thanks! 

Link to comment
Share on other sites

AddPrefabPostInit(
    prefab,
    function(inst)
        -- Client and Server code here
        if not GLOBAL.TheWorld.ismastersim
        then
            return
        end
        -- Server code here
    end
)

Components generally only exist on the server.

There are replicated components and client-only components, yeah, but in this case your component only exists on the server.

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