Search the Community
Showing results for tags 'hammer'.
Found 2 results
I was wondering if anyone has an ideaBelow is the function from a chessjunk prefab that gives 10% chance to spawn hostile clockwork when hammered.I'd like to mod this so that it has a greater chance to spawn hostile clockwork if the source of being hammered is _not_ a player. (such as being struck by a rook's charge, or by a meteor)=-=-=-=-=-=-local function OnHammered(inst, worker)inst.components.lootdropper:DropLoot()if math.random() <= .1 then -- increase this chance if action is NOT from playerlocal pos = inst:GetPosition()TheWorld:PushEvent("ms_sendlightningstrike", pos)SpawnScion(pos, false, inst.style, worker)elselocal fx = SpawnPrefab("collapse_small")fx.Transform:SetPosition(inst.Transform:GetWorldPosition())fx:SetMaterial("metal")endinst:Remove()end=-=-=-=-=-I can easily mod it to change this to a higher chance, but am not sure how to discern if the action is coming from a player.Thank you
Yea, the hammer would be better functioning like the pitchfork. Taking into consideration how effective the hammer is, how valuable the things its meant to destroy are, the unequal return rate of the material of broken items, and the fact that the whole point of the quick store option is to make storage quick and simple; it makes sense that the hammer would be bound on the right mouse button.I don't know of any argument otherwise.