. . . Posted March 29, 2023 Share Posted March 29, 2023 (edited) I want to edit this function in it function ChatHistoryManager:GetDisplayName(name, prefab) return name ~= "" and name or STRINGS.UI.SERVERADMINSCREEN.UNKNOWN_USER_NAME end but i have no idea how I can edit this file, does anyone know how? Edited March 30, 2023 by . . . Link to comment https://forums.kleientertainment.com/forums/topic/146794-solved-how-can-i-edit-a-function-of-chathistorylua/ Share on other sites More sharing options...
-LukaS- Posted March 29, 2023 Share Posted March 29, 2023 chathistory.lua doesn't return a class (so AddClassPostConstruct won't work) but assigns it to global ChatHistory so you can edit that: local old_ChatHistory_GetDisplayName = _G.ChatHistory.GetDisplayName _G.ChatHistory.GetDisplayName = function(self, name, prefab, ...) local old_return_string = old_ChatHistory_GetDisplayName(self, name, prefab, ...) -- Your code end 1 Link to comment https://forums.kleientertainment.com/forums/topic/146794-solved-how-can-i-edit-a-function-of-chathistorylua/#findComment-1627465 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