Instance.new("Part",workspace) local nuke = game.Workspace.Part position = nuke.CFrame while wait(0.1) do nuke.Size = nuke.Size + Vector3.new(0.5,0.5,0.5) nuke.CFrame = position end function onTouch(Brick) local Player = Brick.Parent:FindFirstChild("Humanoid") if(Player ~= nil)then Player.Health = Player.Health - 100 end end nuke.Touched:connect(onTouch)
You are running an infinite loop before connecting the touched event, so the event never gets connected to the part.
Solution:
local nuke = Instance.new("Part", game.Workspace) nuke.Touched:connect(function(hit) local humanoid = hit.Parent:FindFirstChild("Humanoid") if humanoid then humanoid.Health = 0 end end) while wait() do nuke.Size = nuke.Size + Vector3.new(0.5, 0.5, 0.5) nuke.CFrame = CFrame.new() end