• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua How to make a NPC remove all items from the player?

massuco

Brazilian, sorry for my bad english XD
Joined
Feb 17, 2013
Messages
199
Solutions
8
Reaction score
22
Location
Brasil
Im using OTHire latest version from Github.
Im thinking about a NPC, in this case Oracle, that teleports you and remove all your items. What function should I use to start this function? or there is a function for it?
 
Solution
Try this? idk if you have the function 'getPlayerSlotItem'
If you do, this should work no problem.
Lua:
local function doPlayerRemoveAllEquipment(cid)
    if isPlayer(cid) then
        for i = 1, 10 do
            local thing = getPlayerSlotItem(cid, i)
            if thing.uid > 0 then
                doRemoveItem(thing.uid)
            end
        end
    end
end
Im using OTHire latest version from Github.
Im thinking about a NPC, in this case Oracle, that teleports you and remove all your items. What function should I use to start this function? or there is a function for it?

local player_gold = getPlayerItemCount(cid,2148)
local player_plat = getPlayerItemCount(cid,2152)*100
local player_crys = getPlayerItemCount(cid,2160)*10000
local player_money = player_gold + player_plat + player_crys

if getPlayerItemCount(cid,2563) >= 1 then
if doPlayerRemoveItem(cid,2563, 1) then
npcHandler:say('A pan! At last! Take this in case you eat something my cousin has cooked.', cid)
local playerID = getPlayerGUID(cid)
local item = doPlayerAddItem(cid, 2406)
end
else
npcHandler:say('Hey! You don\'t have it!', cid)
end
end



node1 = keywordHandler:addKeyword({'pan'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Have you found a pan for me?'})
node1:addChildKeyword({'yes'}, panpan, {})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = '$&*@!', reset = true})
doPlayerRemoveItem(cid,xxxx, 1)
xxxx= id
1 = amount
 
I know this function, what I mean is, how to remove All items from player, if I dont know what items this player have. Something that remove all items from all slots.
 
I know this function, what I mean is, how to remove All items from player, if I dont know what items this player have. Something that remove all items from all slots.
doRemoveItem(all,all)
esse "all" não reconhece em todos os TFS
apenas alguns modificados, mas teste no seu
 
Try this? idk if you have the function 'getPlayerSlotItem'
If you do, this should work no problem.
Lua:
local function doPlayerRemoveAllEquipment(cid)
    if isPlayer(cid) then
        for i = 1, 10 do
            local thing = getPlayerSlotItem(cid, i)
            if thing.uid > 0 then
                doRemoveItem(thing.uid)
            end
        end
    end
end
 
Solution
Back
Top