local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local target = mouse.Target
local tools = {
--add tools here from wherever you store them. They are copied and put into
--the players inventory.. also, keep em in REPstorage.
game.ReplicatedStorage.Item1:clone();
game.ReplicatedStorage.Item2:clone();
game.ReplicatedStorage.Item3:clone();
game.ReplicatedStorage.Item4:clone();
}
local acceptedItems = {
"Item1";
"Item2";
"Item3";
"Item4";
}
game:GetService('UserInputService').InputBegan:connect(function(input,proc)
if not proc then
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.Q then
if target.Name == acceptedItems[] then --compares strings, ask SH what to put in []'s
print("accepted item detected, taking it now :D")
target:Destroy()
if acceptedItems.Name == tools[] then
tools:Clone() --above singles out a single tool from list
tools.Parent = player.Backpack
end
end
end
end
end
end)
This is actually a request by robloxiveboy , he had to get off right when I finished what I could do. I used to have a game that incorporated this to the next level, but it got deleted along with my old account.
I'm having trouble with singling out a single value from the table in the pastebin code and using that to give said player the correct item (tool in this case)

1 comment
You are a great staff member of SH. Thanks for this, I will use this for my own personal scripts as well . :D