--L_SPECIAL_SILVER-COIN-SPAWNER.lua local newcurrency = 0 function onCollisionPhantom(self, msg) local target = msg.objectID local faction = target:GetFaction() if faction and faction.faction == 1 then self:PlayFXEffect{effectType = "pickup"} newcurrency = target:GetCurrency().currency newcurrency = newcurrency + 1000 target:SetCurrency {currency = newcurrency} self:Die{ killerID = msg.playerID, killType = "SILENT" } end return msg end function onHasBeenCollected(self, msg) local target = msg.playerID local faction = target:GetFaction() if faction and faction.faction == 1 then local newcurrency = target:GetCurrency().currency newcurrency = newcurrency + 1000 target:SetCurrency {currency = newcurrency} end return msg end