Help with instance

Hi, I have a code that creates new instances of a part and I configure them as shown here.
I also have a script element that I want to be executed when those instances touch a player or object. I managed to do it with an object created, placing the script inside it, but with an instance, no. If you can help, I’m grateful.
Note: the script I want to put on the instance is this

In your first script, why dont you add a connection to the variable bola?

local bola = Instance.new("Part")

...

bola.Touched:Connect(function()
    -- Touch event goes here
end)
1 Like

Try using the same script and do the touched function like this:

bola.Touched:Connect(function(hit)
    -- stuff and udhfiaafij
end)
1 Like