Hey so:
I was making a card scanner, so I added a normal part to a model, I would like to make that when a specific tool touches that, makes a sound (beep), just a rblx sound.
Hope someone can help me, thanks!
1 Like
Hereâs some example code:
local debounce = false
Part.Touched:Connect(function(hit)
if hit.Parent:IsA(âToolâ) and hit.Parent.Name == âtoolNameâ and not debounce then
debounce = true
yourSound:Play()
task.wait(2) -- or whatever
debounce = false
end
end)
Added a debounce so the sound doesnât spam, someone correct me if Iâm wrong.
Hope this helps you out
1 Like
SooâŚ
Testing out script and didnât work, If someone can still help me out with this, It would be great!
Here i leave script:
local debounce = false
Part.Touched:Connect(function(hit)
if hit.Parent:IsA(âToolâ) and hit.Parent.Name == âTmobilitatâ and not debounce then -- Tmobilitat is the tool
debounce = true
beep:Play() -- "beep" is the sound.
task.wait(2) -- or whatever
debounce = false
end
end)
1 Like
try printing âhitâ to see what is actually being touched, or add a loop to loop through the character and see if the tool is in their character
2 Likes