Jump to content

Beginner starting a character mod, any tips/help?


Recommended Posts

17 hours ago, FancyBonnie said:

inst:ListenForEvent("oneat", function(inst, data)
    if inst.components.talker ~= nil and data and data.food and data.food:HasTag("meat") then
        inst.components.talker:Say("Ugh, my stomach will never get used to meat..")
    end
end)

-- This initializes for both the server and client. Tags can be added here.
local common_postinit = function(inst) 
    -- Minimap icon
    inst.MiniMapEntity:SetIcon( "wybie.tex" )
end

-- This initializes for the server only. Components are added here.
local master_postinit = function(inst)
    -- choose which sounds this character will play
    inst.soundsname = "wilson"

I assume I put it correct? It says the "inst isn't declared"  

EDIT: I put it under it and it worked. Weird.

The inst:ListenForEvent has to be inside the master_postinit function.

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