Support Email Error (Zendesk) 08/12/2019
Search the Community
Showing results for tags 'strike'.
Found 1 result
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