local lootLOT = 935 -- LOT of the loot object to spawn local numToSpawn = 3 -- number of loot objects to spawn local cooldownTime = 5 -- how long to wait before you can interact with the object again function onStartup(self, msg) self:SetVar("blockImagination",false) self:PlayFXEffect{name = "tikitorch", effectID = 611, effectType = "fire"} end function onUse(self, msg) local player = msg.user print(player) self:PlayAnimation{ animationID = "interact" } if self:GetVar("bActive") then return end local player = msg.user self:SetVar("bActive", true) for i = 1, numToSpawn do local newSpawner = GAMEOBJ:GenerateSpawnedID() self:DropLoot{owner = player, lootID = newSpawner, itemTemplate = lootLOT, rerouteID = player, sourceObj = self} end GAMEOBJ:GetTimer():AddTimerWithCancel( cooldownTime , "InteractionCooldown", self ) end function onSquirtWithWatergun(self, msg) if self:GetVar("isBurning") then self:PlayAnimation{ animationID = "water" } self:StopFXEffect{name = "tikitorch"} self:PlayFXEffect{effectID = 611, effectType = "water"} self:PlayFXEffect{effectID = 611, effectType = "steam"} msg.shooterID:UpdateMissionTask{taskType = "complete", value = 472, value2 = 1, target = self} GAMEOBJ:GetTimer():AddTimerWithCancel( 5.5, "Relight",self ) self:SetVar("isBurning",false) end end function onTimerDone(self, msg) if msg.name == "Relight" then print('relight') self:SetVar("isBurning",true) self:PlayFXEffect{name = "tikitorch", effectID = 611, effectType = "fire"} end if msg.name == "DropImagTime" then self:SetVar("blockImagination",false) end if msg.name == "InteractionCooldown" then self:SetVar("bActive", false) end end