Jump to content
Sign in to follow this  
Edilson

Disable and Enable Effect

Recommended Posts

Hello everyone, 

I have this problem, my item Disable and Enable. any help me? see this below image.

 

Quote

        local Swing = GetChaItem(role, 2, 0)
        local Swing_ID = GetItemID(Swing)
        if Swing_ID == 9137 then
            local statelv = 1
            local statetime = 3600
            AddState(role, role, STATE_SWINGSK1, statelv, statetime)        
        else
            local state_swingsk1 = GetChaStateLv(role, STATE_SWINGSK1)
            if state_swingsk1 ~= 0 then
                RemoveState(role, STATE_SWINGSK1)
            end
        end

 

cap00000.jpg

Share this post


Link to post
Share on other sites

Hello, @Edilson!

 

Add some debug messages to your code and check them:

        local Swing = GetChaItem(role, 2, 0)
        local Swing_ID = GetItemID(Swing)
	Notice("Swing_ID = " .. Swing_ID)
        if Swing_ID == 9137 then
            local statelv = 1
            local statetime = 3600
		Notice("Activating...")
            AddState(role, role, STATE_SWINGSK1, statelv, statetime)        
        else
            local state_swingsk1 = GetChaStateLv(role, STATE_SWINGSK1)
            if state_swingsk1 ~= 0 then
		Notice("Deactivating...")
                RemoveState(role, STATE_SWINGSK1)
            end
        end

 


Share this post


Link to post
Share on other sites
15 hours ago, V3ct0r said:

Hello, @Edilson!

 

Add some debug messages to your code and check them:


        local Swing = GetChaItem(role, 2, 0)
        local Swing_ID = GetItemID(Swing)
	Notice("Swing_ID = " .. Swing_ID)
        if Swing_ID == 9137 then
            local statelv = 1
            local statetime = 3600
		Notice("Activating...")
            AddState(role, role, STATE_SWINGSK1, statelv, statetime)        
        else
            local state_swingsk1 = GetChaStateLv(role, STATE_SWINGSK1)
            if state_swingsk1 ~= 0 then
		Notice("Deactivating...")
                RemoveState(role, STATE_SWINGSK1)
            end
        end

 

 

Now this error is appearing on the system.

cap00000.jpg

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...