• Custom entity variables
    2 replies, posted
Okay, so I may just be tired, but I'm stumped on this. I'm making an NPC, and It's an NPC base kinda that will change titles on menus they pop up. It spawns just fine, but I need to have different titles and stuff on the derma for each npc I create with that base. How can I set the text from another lua file using a function? I've tried making functions with self.SetTitleText, and ENT.SetTitleText, but neither work. I hope that explains it.
So you're making NPCs with menus, or am I wrong?
[lua] function ENT:Initialize() self.TitleText = "Untitled" end function ENT:SetTitleText( str ) self.TitleText = str end function ENT:GetTitleText() return self.TitleText end[/lua] That should work. Call it just like entity:SetTitleText("text").
Sorry, you need to Log In to post a reply to this thread.