local function pickup()
local tool = script.Parent.Parent
local proxpromp = script.Parent.ProximityPrompt
proxpromp.Triggered:Connect(function(plr)
tool.Parent = plr:WaitForChild("Backpack")
end
end
pickup()
since you want a custom pickup, you also need a custom drop so you can return it into a model and then when you pick it up, it returns to a tool object. I have done this once and you can do it by making a module script of pick up so you can reuse the code in any other objects
in a module script, write this:
local module = {}
function module.PickupModule(item, proximityprompt, plr) -- item that you want to drop,
--and also the proximity prompt so you can disable it, also add the player
local tool = Instance.new()
tool.Name = item.Name -- copies the exact name of the item that is picked up
for _, v in pairs(item:GetChildren()) do -- gets the children of the item
v.Parent = tool
end
tool.Parent = plr.Backpack -- puts the tool in the backpack of the player who picked it up
pp.MaxActivationDistance = 0
tool.CanBeDropped = false -- since you are going to make your own drop script
end
return module
name this ‘PickupModule’ and place it in the ServerStorage, but you can change it (i just named it this since i’m showing an example)
NOTE: this must be a module script
now inside your proximity prompt, add a server script and write this
ServerScript inside the proximity prompt
local pp = script.Parent -- the proximity prompt but since script is parented to the prompt
local pickmodule = require(game.ServerStorage.PickupModule)
local item = --item you want to pickup (this must be a model since you are going to turn it into a tool by getting all the child
pp.Triggered:Connect(function(plr))
pickmodule.PickupModule(item, pp, plr)
end)
now, you need to make your own drop script to turn the tool into a model again.
you can do it with userinput service in a local script and then send a remote event from the client to server which drops the item the player is holding.
the item you want to pickup should be a model instead of just tool (so you can’t pick it up) and then when you drop it return it into a model, oh and also i recommend using module script so you can just use the module for every item you want to pickup.