Alright, so I need to insert a tool into a players backpack when a tool they are holding touches a part. How do I do so?
Heres the script I tried to make:
local tool = script.Parent
local Handle = tool.Handle
Handle.Touched:connect(function(hit)
end)
if debounce == true then
return
end
debounce = true
if Handle.Touched:connect(function(hit) Name = "123456" then clone.game.ServerStorage.cookedbred = plr.Backpack
end
PLEASE HELP!!! NEED THIS SOON!!!
Edit: I have no idea what I was thinking before because that code had a lot of errors to fix. The correct script is located below:
local tool = script.Parent local Handle = tool.Handle local debounce = false Handle.Touched:connect(function(hit) if debounce == true then return end debounce = true if hit.Name == "123456" then local clone = game.ServerStorage.cookedbred:Clone() clone.Parent = game.Players[Handle.Parent.Parent.Name].Backpack end wait(1) debounce = false end)
Sorry about the last answer. Please accept this one if it helped and don't hesitate to ask questions.