So I have this script where if you have a tool out in your hand, and you touch the brick that this script is inside of, it places the tool that is named in the script. In this specific one it is named Sandbag. I want to make it so you click instead of touch.
local Part = script.Parent
local debounce = false
local SandbagString = "Block"
Part.Touched:Connect(function(toucher)
if toucher.Parent:FindFirstChild(SandbagString) and toucher.Parent:FindFirstChild("Humanoid") and debounce == false then
debounce = true
local char = toucher.Parent
local Sandbag = char[SandbagString]
local Handle = Sandbag.Handle
Handle.Parent = Part
Sandbag:Destroy()
Handle.Anchored = true
Handle.CanCollide = false
Handle.Position = Part.Position+Vector3.new(0,.8,0)
Handle.Orientation = Vector3.new(0,math.random(0,0),0)
end
end)
Thank you!
