Jump to content

Recommended Posts

1 hour ago, icantevenname said:

Have ya looked at Wicker's .lua?

It'll be in data -> databundles -> scripts.zip -> scripts -> prefabs

i found code 

    inst.components.builder.science_bonus = 1

inside of function 

local function master_postinit(inst)

end

the original mod i had which worked up until the post gorge update, had that exact line, but the error says that builder is undefined, for reference here is the code that used to word (modmain shown cos modinfo is useless)

function wxpostinit(inst)

	inst.components.builder.science_bonus = 1
end

AddPrefabPostInit("wx78", wxpostinit)

any help would be appreciated, thanks for responding :D

EDIT:

unknown.png?width=800&height=251this is the exact syntax error

Edited by The95Chaps
adding syntax error
1 hour ago, IronHunter said:

Components unless they are replicable are server side only usually.

You probably need to make sure your code doesn't run on the client.

See the Global is the mastersim in the if statement.

i dont understand

15 hours ago, IronHunter said:

AddPrefabPostInit("wx78", function(inst)
	if GLOBAL.TheWorld.ismastersim then
      		if inst.components.builder ~= nil then
			inst.components.builder.science_bonus = 1
        	end
	end
end)

 

well, this works perfectly! thanks for you're help fam

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