FaZZa Posted April 1, 2016 Share Posted April 1, 2016 (edited) 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: Edited April 1, 2016 by FaZZa Link to comment Share on other sites More sharing options...
DarkXero Posted April 1, 2016 Share Posted April 1, 2016 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 More sharing options...
FaZZa Posted April 2, 2016 Author Share Posted April 2, 2016 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 More sharing options...
Aquaterion Posted April 2, 2016 Share Posted April 2, 2016 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 More sharing options...
FaZZa Posted April 3, 2016 Author Share Posted April 3, 2016 Ah okay, well thanks for the help guys, much appreciated. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now