Sign in to follow this  
W1nged

Help with modding a custom item

Recommended Posts

W1nged    1

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

 

Share this post


Link to post
Share on other sites
W1nged    1
On 26.10.2019 at 2:59 AM, Ultroman said:

Does that code not work?

In single player there is no

Share this post


Link to post
Share on other sites
W1nged    1
On 29.10.2019 at 12:20 AM, Ultroman said:

Please post your entire mod so I can test it.

Sorry for the long answer, I have already fixed everything, thanks for your activity!

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this