Jump to content

Remove item from player


murilo2929

Recommended Posts

So, I'm making a skin pickup on my server and I'm trying to make sure that when the player already has a skin it is removed from inventory, but the problem is that when the skin is in inventory and goes through the pickup it is not removed. .

thePickup = createPickup ( -32.2197265625, -138.232421875, 1003.546875, 3, 1275, 1000 )
setElementDimension(thePickup, 72)
setElementInterior(thePickup, 16)
function testepickup ( thePlayer )
             if exports.dota:hasitm( thePlayer, 1, 50) then
		          exports.dota:takeitm( thePlayer, 1 50)
		end
 local theTeam = getPlayerTeam(thePlayer)
		    local factionType = getElementData(theTeam, "type")
			if factionType==90 then
		        exports.dota:giveitm( thePlayer, 1, 50 )
				end
            
end
addEventHandler ( "onPickupUse", thePickup, testepickup )

OBS : remembering that the player can only get the skin if it is faction 90
OBS²: I was seeing that if I am not in the faction while picking up the skin in the inventory it is removed normally, but when I am in the faction it is not removed.

Link to comment
  • Moderators
1 hour ago, murilo2929 said:

I fix it, but not changed, Still not taking the skin off the inventory when you have it, only when I am not in the faction.

 

What are you waiting for? :shocked!:

You know which function is not working properly and yet you are only looking at your own resource?

Question for yourself:

What are the conditions and expected returned results of the takeitm function?

 

  • Like 1
Link to comment

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...