Jump to content

Recommended Posts

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!

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 by Bad Willow
  • Sanity 1

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!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...