FezuPapa Posted November 17, 2021 Share Posted November 17, 2021 Hello ! I'm trying to make an infinite Alarming clock but i don't know why this is not working. I really don't understand what is the problem, maybe the prefab is wrong ? AddPrefabPostInit('pocketwatch_weapon', function(inst) inst:RemoveComponent("finiteuses") end) Thanks! Link to comment https://forums.kleientertainment.com/forums/topic/135368-help-making-my-first-mod-infinite-weapon/ Share on other sites More sharing options...
skittles sour Posted November 17, 2021 Share Posted November 17, 2021 (edited) what is in general called "durability" manifests itself in a variety of components. with pocket watches i think it uses the fueled component instead. Also know that, while sometimes making something infinite is as simple as removing a specific component, very often with more sophisticated items this will crash since other functions will assume the existence of the component. a more delicate fix would be, for example, to set the rate to zero, when it's the fueled component, or nullifying the use function by doing inst.components.finiteuses.Use = function() end, when it's the finiteuses component. there are a variety of "infinitizer" mods on the workshop that you can check out. If you've ever played the starving floor game mode you can also check the code to see the ways it infinizes weapons and stuff. Edited November 17, 2021 by Bad Willow 1 Link to comment https://forums.kleientertainment.com/forums/topic/135368-help-making-my-first-mod-infinite-weapon/#findComment-1513978 Share on other sites More sharing options...
FezuPapa Posted November 18, 2021 Author Share Posted November 18, 2021 Thanks a lot, still not working tho but i'm woking on it .. I tried many thing and this is the last code i wrote local function pocketwatch_weaponPostInit(inst) inst:AddComponent("finiteuses") inst.components.finiteuses.Use=function () end end AddPrefabPostInit("pocketwatch_weapon", pocketwatch_weaponPostInit) when I tried to add this line the game crash inst:RemoveComponent("fueled") So maybe there is a command to keep the item always full, but didnt find anything, still looking for it! Link to comment https://forums.kleientertainment.com/forums/topic/135368-help-making-my-first-mod-infinite-weapon/#findComment-1514140 Share on other sites More sharing options...
skittles sour Posted November 18, 2021 Share Posted November 18, 2021 instead of adding and removing the finite component, try this: inst.components.fueled.rate = 0; and if this doens't work, inst.components.fueled.StartConsuming = functin() end Link to comment https://forums.kleientertainment.com/forums/topic/135368-help-making-my-first-mod-infinite-weapon/#findComment-1514506 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