Pivity

I have a Question to all Developers here (Autopickup System & Loot System)

Last read Never
#1

I have a question

How can I make an automatic system where my items go directly to the inventory instead of spawning on the floor

//This is the AddItem Function
function Entity:AddItem(strItem, intAmount, force)

//This is the Transfer Function
function Entity:TransferItem(objTarget, strItem1, intAmount1, strItem2, intAmount2)

// I hope you can me Help

I have here the Function from my Inventory I mean I kill one NPC here is Drop Items on the World

Who can i scripting this for my Server the Pickup this to Inventory?

This is the Underdone RPG Gamemode and @The Commander does not even read my questions via support

Edited when i Change the Code the NPC drop not more Items

for strItem, tblInfo in pairs(tblNPCTable.Drops or {}) do
local tblItemTable = ItemTable(strItem)
-- 244132089
if npcTarget:GetLevel() >= (tblInfo.MinLevel or 0) then
if !tblItemTable.QuestItem or (entKiller:GetQuest(tblItemTable.QuestItem) && !entKiller:HasCompletedQuest(tblItemTable.QuestItem)) then
strItem, tblInfo = entKiller:CallSkillHook("drop_mod", strItem, tblInfo)
local intChance = (tblInfo.Chance or 0) * (1 + (entKiller:GetStat("stat_luck") / 45))
local ItemChance = 100 / math.Clamp(intChance, 0, 100)
if math.random(1, (ItemChance or 100)) == 1 then
local intAmount = math.random(tblInfo.Min or 1, tblInfo.Max or tblInfo.Min or 1)
local entLoot = CreateWorldItem(strItem, intAmount, npcTarget:GetPos() + Vector(0, 0, 30))
entLoot:SetOwner(entKiller)
--if tblItemTable and tblItemTable.Use and self:HasItem(strItem) then end
-- entLoot:GiveItem(self, strItem, intAmount)
local phyLootPhys = entLoot:GetPhysicsObject()
if !IsValid(phyLootPhys) && IsValid(entLoot.Grip) then phyLootPhys = entLoot.Grip:GetPhysicsObject() end
phyLootPhys:Wake()
phyLootPhys:ApplyForceCenter(Vector(math.random(-100, 100), math.random(-100, 100), math.random(350, 400)))
end
end
end
end

and i Hope you have a idea

Dumb x 3Funny x 1
#2

(Wrong section btw)

-> https://www.gmodstore.com/jobs/

or -> https://gmod.facepunch.com/f/gmoddev

#3

Momox i have this self become.. I will Know who i create the best Function

Agree x 1
#4

This is not your local tech support center

Agree x 1Funny x 1Winner x 1
#5

Did I just hear tech support? https://www.gmodstore.com/community/threads/4002-gmod-selling-tech-support-for-gmod-darkrp-server/post-28535#post-28535

Funny x 1Winner x 1
#6
ByHero / Tadel / Palaat 16th of December 2017 15:47:28
Momox i have thisself become..I will Know who i create the best Function

Maybe this will answer your question.

This isn't how2lua.

Agree x 1
#7
ByHero / Tadel / Palaat 16th of December 2017 13:11:47
This is the Underdone RPG Gamemode and@The Commander does not even read my questions via support

I can't reply to support questions when your English is so terrible. I have told you multiple times to get someone that can actually speak English to write your tickets for you.

Winner x 1
Users viewing this thread
Nobody