Jump to content

Help with modding a custom item


W1nged

Recommended Posts

Hi everyone,
I have a weapon like a boomerang and I have this idea to implement it this way: it does not cause damage, but stuns. I had a similar implementation for the DST, now I port to the DS, I do not know how to properly issue. Thanks in advance!

my code for this item in dst:

Spoiler

local function onattack_wand(inst, attacker, target)
            if target.sg and target.sg:HasState("stunned") and target.prefab ~= "buzzard" then
                target:DoTaskInTime(0, function(self)
                    self.sg:GoToState("stunned")
                end)
            elseif target.prefab == "butterfly" or target.prefab == "bee" or target.prefab == "killerbee" or target.prefab == "mosquito" then
                target:DoTaskInTime(0, function(self)
                    --self.sg:SetTimeout(2) -- 0.15
                    --self.components.locomotor:Stop()
                    self.sg:GoToState("land")
                    if self.components.inventoryitem then
                        self.components.inventoryitem.canbepickedup = true
                    end
                end)

            end
end

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...