Demon Hawking Posted April 12 Share Posted April 12 (edited) I have a mod (not mine) that I would like to tweak. I would like to add flat planar damage to a weapon. How could I achieve that? Edited April 12 by Demon Hawking Link to comment https://forums.kleientertainment.com/forums/topic/170717-little-help-with-coding/ Share on other sites More sharing options...
Haruhi Kawaii Posted April 14 Share Posted April 14 On 4/12/2026 at 7:53 PM, Demon Hawking said: I have a mod (not mine) that I would like to tweak. I would like to add flat planar damage to a weapon. How could I achieve that? You need to find the prefab name of that weapon and then paste this code into your modmain file. You can find the prefab name using some mods in the workshop, console, or client_log. AddPrefabPostInit("prefabmod", function(inst) if not GLOBAL.TheWorld.ismastersim then return end inst:AddComponent("planardamage") inst.components.planardamage:SetBaseDamage(20) end) Link to comment https://forums.kleientertainment.com/forums/topic/170717-little-help-with-coding/#findComment-1861402 Share on other sites More sharing options...
Demon Hawking Posted April 14 Author Share Posted April 14 6 hours ago, Haruhi Kawaii said: You need to find the prefab name of that weapon and then paste this code into your modmain file. You can find the prefab name using some mods in the workshop, console, or client_log. AddPrefabPostInit("prefabmod", function(inst) if not GLOBAL.TheWorld.ismastersim then return end inst:AddComponent("planardamage") inst.components.planardamage:SetBaseDamage(20) end) Thank you for the reply. Where should I paste the code if the addprefab looks like this? I tried to add it under the damage, walkspeed multiplier and at the end, but none of it worked. Link to comment https://forums.kleientertainment.com/forums/topic/170717-little-help-with-coding/#findComment-1861508 Share on other sites More sharing options...
Haruhi Kawaii Posted April 15 Share Posted April 15 20 hours ago, Demon Hawking said: Thank you for the reply. Where should I paste the code if the addprefab looks like this? I tried to add it under the damage, walkspeed multiplier and at the end, but none of it worked. Currently, I don't see any problems with that code. Are you sure you've got the prefab name correct? Try your changes with a vanilla game prefab like Spear. Also, check your modinfo; that code only works on mods that are server-only. Link to comment https://forums.kleientertainment.com/forums/topic/170717-little-help-with-coding/#findComment-1861927 Share on other sites More sharing options...
Demon Hawking Posted April 15 Author Share Posted April 15 1 hour ago, Haruhi Kawaii said: Currently, I don't see any problems with that code. Are you sure you've got the prefab name correct? Try your changes with a vanilla game prefab like Spear. Also, check your modinfo; that code only works on mods that are server-only. I tried some things and it turned out that another mod was causing issues with planar damage values. After I uninstaled it the code started working. Thank you for your help with the code. 1 Link to comment https://forums.kleientertainment.com/forums/topic/170717-little-help-with-coding/#findComment-1861954 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