1 | local brick = game.Workspace --the part that u wnt to have explode when touched |
2 |
3 | brick.Touched:connect( function (hit) |
4 | if hit.Parent and hit.Parent.Humanoid then |
5 | humanoid = hit.Parent.Humanoid |
6 | explode = Instance.new( "Explosion" , brick) |
7 | end ) |
01 | function ont (hit) |
02 | local humanoid = hit.Parent:FindFirstChild( "Humanoid" ) |
03 | if humanoid then |
04 | local e = Instance.new( "Explosion" ) |
05 | e.Parent = script.Parent |
06 | e.Position = script.Parent.Position |
07 | end |
08 | end |
09 |
10 | script.Parent.Touched:connect(ont) |
There you go, that should work!