This question will sound very stupid, but ... how can I make my script detect several parts?
local deb = false
script.Parent.Touched:Connect(function(hit)
local h = hit.Parent:FindFirstChild("Humanoid")
if h and not deb then
local plr = hit.Parent.Name
deb = true
diamante.Transparency = 1
game.Players[plr].leaderstats.Diamonds.Value = game.Players[plr].leaderstats.Diamonds.Value + 10
game.Players[plr].XP.EXP.Value = game.Players[plr].XP.EXP.Value + 1
wait(4)
deb = false
diamante.Transparency = 0
end
end)
This script is inside a diamond and is executed by touching it, but I have a total of 20-30 diamonds with the same script in each one ..Any idea on how to use a single script for all diamonds?
Thanks!

2 comments
made a few mistakes in the first post, check for edits
on line 8, the parameter of function "func" isn't necessary, it is more commonly done as value.Touched:Connect(func)