Jump to content

Mod Character noises gone


Recommended Posts

Hi there,

Im making a mod for a custom character, and i want them to be able to read, however when ever i put the code to allow him to read, it stops him making noises when he speaks. I tried removing the code and he made the noises again.  Example: I click on the portal, and hell say "its rickety but it functions etc" however no noise will  play to go with it. 

Anyone know how to fix this problem?

This is the code that im using to make the character read:

local function master_postinit(inst)
    inst:AddComponent("reader")
    
end

Thanks in advance.

Heres a screenshot of the code:

charcode.png

Edited by FaZZa
Link to comment
Share on other sites

local function master_postinit(inst)
	inst:AddComponent("reader")
end

equals

local master_postinit
master_postinit = function(inst)
	inst:AddComponent("reader")
end

 

You also should know, that if I have a variable, and I do this

local a = 1
a = 2

then the value of a is 2, not 1, because I assigned a new value.

 

Basically discarding your first function (which has the sounds specification).

	inst.OnNewSpawn = onload

	inst:AddComponent("reader")
end

Put the line inside the master_postinit function.

Link to comment
Share on other sites

Thanks for the reply, ive fixed the problem, i do have one question though,

12 hours ago, DarkXero said:

You also should know, that if I have a variable, and I do this


local a = 1
a = 2

then the value of a is 2, not 1, because I assigned a new value.

What did you mean when you put this? is this for the damage modifier? Because it didnt seem to fit anywhere for the reader part of the code.

Thanks again

Link to comment
Share on other sites

2 hours ago, FaZZa said:

Thanks for the reply, ive fixed the problem, i do have one question though,

What did you mean when you put this? is this for the damage modifier? Because it didnt seem to fit anywhere for the reader part of the code.

Thanks again

he meant that since you used 2 master_postinit, the second master_postinit replaced the first one.

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