Honeebey Posted June 22, 2025 Share Posted June 22, 2025 Hello all! I'm trying to make a client-side admin-only mod which would allow me to manually set aggro for mobs by selecting them and then pressing a button that would access the combat component of a selected entity to change the target. However, I've run into a roadblock; the game recognizes that the selected entities have been selected, and that they have components, but apparently is unable to access/change/tell-that-specific-components are there. Is there any way for me to modify the components of individual, selected entities in-game? Additionally, this is the problem code (v.components.combat returns nil, regardless of whether or not the entity has a combat component.) I am capable of using v.components.combat:SetTarget(tar) in the in-game console once I've defined the variables, so I'm somewhat confused on how I might get this working. If there's some way to call commands through the console from the modmain, that might also work, but I'm unsure if such a function exists. for k,v in pairs(Ents) do if v:HasTag("honey_mob") then if v.components.combat ~= nil then -- this returns nil, regardless of whether or not the entity has a combat component. v.components.combat:SetTarget(tar); end end end Attached is my full modmain.lua if a comprehensive look at the file would help you. modmain.lua Link to comment https://forums.kleientertainment.com/forums/topic/166637-help-is-there-any-way-to-edit-the-components-of-specific-entities-in-game/ Share on other sites More sharing options...
Baguettes Posted June 22, 2025 Share Posted June 22, 2025 Look what you can do in combat_replica.lua; components only exist on the server and will always be nil on the client. Link to comment https://forums.kleientertainment.com/forums/topic/166637-help-is-there-any-way-to-edit-the-components-of-specific-entities-in-game/#findComment-1823846 Share on other sites More sharing options...
Honeebey Posted June 22, 2025 Author Share Posted June 22, 2025 Alright, I will! Thank you! Link to comment https://forums.kleientertainment.com/forums/topic/166637-help-is-there-any-way-to-edit-the-components-of-specific-entities-in-game/#findComment-1823853 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